NinjaCipher:-*-:ro60

password protection with htaccess

Here is a short example of password protecting a directory with htaccess and htpassword.

#put this is your .htaccess file that resides
#in the directory that you wish to protect

AuthUserFile /path/to/whereever/.users
AuthType Basic
AuthName "Miami"
<LIMIT GET POST&gt
require valid-user
</LIMIT&gt

#run this command after you add the htaccess
#command to add a user to a newuser file
sudo htpasswd -c /path/to/whereever/.users newusername

#command to add a user to an exsisting file
sudo htpasswd /path/to/whereever/.users newusername

you will then be prompted twice for the new password for the username that you chose in the command above. Thats all folks…

Enjoy,
NC

Del.icio.us Digg BlinkList Furl Ma.gnolia Reddit Spurl

Leave a Reply

You must be logged in to post a comment.