I wanted to protect a Shopware 6 installation with a htaccess auth protection. But when i set it up in the .htaccess file in the /public folder i always get a "htaccess loop" in the backend (after login) and i can't use it anymore.
I tried to exclude /api and /admin but i am not happy with that.
How can i solve the problem?
/public/.htaccess
AuthName "Prompt"
AuthType Basic
AuthUserFile /home/my-project/.htpasswd
Require valid-user
SetEnvIf REQUEST_URI "(/admin)" ALLOW
SetEnvIf REQUEST_URI "(/api)" ALLOW
<RequireAny>
Require env ALLOW
Require valid-user
</RequireAny>