Password protecting your site using .htaccess / .htpasswd


1. Update .htaccess file to the root of your site with the following content:

AuthName "Authorisation Required"
AuthUserFile "/path/to/.htpasswd"
AuthType Basic
require valid-user
ErrorDocument 401 "Authorisation Required"
2. Create & upload the .htpasswd file to ‘AuthUserFile’ path with the following content:
foo:$testing$f#$ffgJHFjhfRGV.
3. generate about line using username & password uaing this site http://www.htaccesstools.com/htpasswd-generator/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s