Posted By

beneberle on 08/05/10



Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


.htaccess Basic Authentication

 / Published in: Apache

Put this in an .htaccess file to protect the directory it is in and anything below it. This requires that a file named .passwdfile exists in the directory \\"/full/path/to/\\" and contains at least one username/password combination.\r\n\r\nUse this snippet to generate the .passwdfile\r\n\r\n[Use this snippet to generate the .passwdfile]( \\"htpasswd\\")

  1. AuthUserFile /full/path/to/.passwdfile
  2. AuthGroupFile /dev/null
  3. AuthName "Realm Name"
  4. AuthType Basic
  5. require valid-user

Report this snippet  

You need to login to post a comment.