file access protected by .htacess file didn't take password stored in .htpsswd file?

36 views Asked by At

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

There are 2 answers

0
lalit mohan On BEST ANSWER

work perfect, it was mistake in file name (spelling) ..

1
Kshux On

This normally happens when the password is incorrect. Change the contents of your .htpasswd file to:

admin:$apr1$ol.jlx5P$ldshyeA.03GTKJWGFgQYH/

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.