Tuesday, September 11, 2012

Password Protecting with .htaccess

1. create password file with encrypted password. Save password file as .ht{something} outside web root if possible.

for example .htukrpass file contain following
username:password

2. create .htaccess file with following content


AuthUserFile {fullpath to .htukrpass file}
AuthType Basic
AuthName "our test source dir"
Require valid-user
require user {username}