Code: Select all
AuthUserFile /full/path/to/your/.htpasswd
AuthType Basic
AuthName "name for your file/folder"
Require valid-user
authname - this is not your username, this is simply a name displayed (password for blabla @ yoursite)
2. now make a file called ".htpasswd" and put your username:password in it.
Note that username has to be encrypted, this can be done with the special .htaccess password generators. like these:
http://www.4webhelp.net/us/password.php
http://www.htmlite.com/HTA006a.php
3. now put both, ".htaccess" and ".htpasswd" into the folder you wan't to protect
Thats all, now when you wan't to enter that folder you need to enter user and pass.
I have also included example files with username as "admin" and password as "test", look below.