To password protect a web site or a sub folder using .htaccess, create a .htaccess file in the folder.
1 |
vi .htaccess |
Add following content
1 2 3 4 |
AuthType Basic AuthName "Restricted Content" AuthUserFile /etc/apache2/site-logins Require valid-user |
In this case, i used /etc/apache2/site-logins as AuthUserFile, this will store all user and password. You can change this file path to whatever you need. Make sure it is not accessable […]