Category Archives: Apache

Protect a location from Apache

Sometimes, you need to protect a certain location with Http Access and users must enter username and password to view that location. A simple way to do this is from Apache configuration file or from .htaccess <Location /my_location> AllowOverride AuthConfig AuthName “Please login!” AuthType Basic AuthUserFile /passwd/.htpasswd require valid-user <LIMIT GET> require my_user </LIMIT> </Location>… Read More »

Send Error 404 Page not found from Apache

If you want to set an error page which will be shown everytime a user tries to access something that isn’t on your server, the best way to do this is from Apache configuration. All you have to do is to insert the following line into httpd.conf or other configuration file. ErrorDocument 404 http://domain.com/404_friendly_error_page.htm Cheers,