Password protection in .htaccess

To password protect a folder by using .htaccess file;

# vi /home/username/.htpasswds/.htpasswd




then create a .htaccess file in respective folder which you want to protect

# vi .htaccess

and add following

AuthUserFile /home/username/.htpasswds/.htpasswd

AuthType Basic

AuthName “Login Details”

Require valid-user

the path depends on the location of the .htpasswd file.

Tagged . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.