Search code examples
apache.htaccessconfiguration-filesserver-configuration

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


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


Solution

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