TECHIES WORLD

For Techs.... Techniques.... Technologies....

ApacheCpanelLinuxPHP

Prestashop prompting for htaccess login two times

If the website is protected with htpassword, it will asks for the logins once. But for Prestashop framework, its asking for the authentication again even if the given credentials are correct.

This is because of that there is an https redirect inside the .htaccess file. So it is asking for the authentication once in http, and once in https.

We can solve this problem by modifying password protection configuration in htaccess file as follows.

<If "%{HTTPS} == 'on'">
    AuthType Basic
    AuthName "Protected Area"
    AuthUserFile "/full-path/.htpasswd"
    <IfVersion >= 2.4>
        AuthMerging And
    </IfVersion>
    Require valid-user
</If>

Here we need to replace "/full-path/.htpasswd" appropriately.

That's all…

Leave a Reply