I have tried it in Magento root
AuthUserFile /home/username/public_html/.htpsswd
AuthType Basic
AuthName "restricted area"
<files "index.php" >
Require valid-user
</files>
I tried to protect access index.php file by .htaccess file by above code
I find base path on AuthUserFile by php code
<?php
echo getcwd();
?>
Here’s my .htpsswd file
admin:admin
Everytime I enter password it show popup which ask for password again and again
2
Answers
work perfect, it was mistake in file name (spelling) ..
This normally happens when the password is incorrect. Change the contents of your .htpasswd file to:
Now you should be able to log in using:
username: admin
password: admin
If that doesn’t work, Check and make sure the path to your .htpasswd file is correct.