skip to Main Content

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


  1. Chosen as BEST ANSWER

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


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search