Simple .htaccess protection

From D3xt3r01.tk
Revision as of 15:19, 8 December 2010 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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