Simple .htaccess protection

From D3xt3r01.tk
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

WHY

Because I bet many of you that don't have knowledge about this kind of stuff wanted to know how is this done ... it's actually more simple than you think !

HOW

Put this in a file named ".htaccess" in a directory you want to be protected.

AuthType Basic
AuthName "Password Required"
AuthUserFile /full/path/to/your/.passwds
Require valid-user

In the command line for the first user do this ( for all the other users you can drop the -c ) :

htpasswd -c .passwds dexter
#New password:
#Re-type new password:
#Adding password for user dexter

LINKS

Apache Tutorial: .htaccess files