Home > Support > HOWTO List > Web > htaccess

Web howtos

Password Protecting Your Web Pages: htaccess

Want to prevent people from viewing the files in a particular web directory?

Here are the steps that will enable you to secure a web directory (in this example, /var/www/html/admin directory or http://yourip/admin/).

Your .htaccess file options will look like this:

AuthType Digest
Require valid-user
AuthName "Admin"
AuthUserFile /etc/apache2/.htpasswd

Hit 'Apply Changes' (one of the tabs under the header on the main Apache Webserver page).

Resolving: "/etc/htaccess: order not allowed here" error in the Apache error_log

You may have selected one of the Access Checking Order options (e.g. 'Deny then allow'). You'll need to have an "AllowOverride All" (cf. AllowOverride AuthConfig) for this option to be valid for your server.