.htaccess Basic Authentication

/ Published in: Apache
Save to your folder(s)

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](http://snipplr.com/view/38523/htpasswd-basic-authentication--create-userpass-with-encrypted-password/ \\\"htpasswd\\\")

Copy this code and paste it in your HTML
  1. AuthUserFile /full/path/to/.passwdfile
  2. AuthGroupFile /dev/null
  3. AuthName "Realm Name"
  4. AuthType Basic
  5. require valid-user

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.