Password Protecting Site Using .htaccess / .htpasswd in Magento

1) Modify .htaccess file with the following content Add on the top. : –
AuthName “Authorisation Required”
AuthUserFile “/path/to/.htpasswd”
AuthType Basic
require valid-user
ErrorDocument 401 “Authorisation Required”


2) Create and upload the .htpasswd file to ‘AuthUserFile’ path with the following content :-


Where shreeji is the Username and $apr1$JegUP0J.$zZtxprxtvzg2CHxb.xTU10 is the MD5 encrypted password.

You can Generate Password from Following link:
Hope this helps you in password protecting your site.