How to password protect web directory (folder)
Tuesday, July 26th, 20051. Create .htaccess file with the content below:
AuthUserFile /home/username/htdocs/.htpasswd
AuthName “Password Protected”
AuthType Basic
require valid-user
Of course in the AuthUserFile type in the location of the .htpasswd file (i.e. when you want to store that file, you’ll create it in next step)
2. Set password for the user(users) (-c option creates .htpasswd file)
If it is your first user’s password […]