Password protection in .htaccess

To password protect a folder by using .htaccess file;

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

BBC:T52pU9TTVjMXQ

ie

user:md5password

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