Password Protection with htpasswd
この記事のURLApache .htaccess tweaking tutorial at Vortexmind: free your mind
Password Protection with htpasswd
This is useful if you want to add password protection to some pages/folders
* Create a .htpasswd file in the folder you want to protect
* The file will contain login data in the form username:password. Username is plain text. Password should be encrypted or it won’t work! Use this tool to get your string to add
* If you create the file on your local pc, be sure to upload it on the webserver in ASCII mode
* Now you can modify your .htaccess file. The authentication will apply to the folder where you place it and its subfolders:
AuthUserFile /home/pathto/.htpasswd
AuthType Basic
AuthName "My Secret Folder"
require valid-user
You can protect a single file by placing this into a
* Be sure to protect your .htaccess file from viewing using the 1) tip


