Cameron Rangeley

Broadcasting live from Auckland, New Zealand

Flower

Simple .htaccess for folder protection

in the configuration file for your virtual host and between the tags you can insert the following lines of code to protect a folder.


AuthType Basic
AuthName “Members Only”
AuthUserFile /path/to/htpasswd
Require valid-user

After you have added that you can save and exit the config file. We now need to create the htpasswd file. from the linux command prompt type in htpasswd -c /path/to/htpasswd username the htpasswd program will prompt you for a password.

Reload apache /etc/init.d/apache2 reload and you are done.

One Response to “Simple .htaccess for folder protection”

  1. June 11th, 2010 at 6:49 pm

    Webmaster says:

    Hello! Please e-mail me your contacts. I have a question webmaster@complective.ru” rel=”nofollow”>……

    Thank you!!!…

Leave a Reply