Change your SetEnvIf
line to this:
SetEnvIf Request_URI ^/(api|index\.php) noauth=1
Vra
I am looking for solution since few hours and i can't figure out how to exlude one locatio from AuthBasic in .htaccess file. I found solutions on the internet, but they work only without RewriteRule enabled.
My .htaccess file:
SetEnv APPLICATION_ENV development
SetEnvIf Request_URI ^/api noauth=1
Order Deny,Allow
Allow from env=noauth
Deny from all
Satisfy any
AuthType Basic
AuthName "Restricted"
AuthUserFile .htpasswd
Require valid-user
RewriteEngine On
IndexIgnore */*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php
This exception works when i comment last line (with RewriteRule) but then of course rewrite engine not works which is necessary.
Oplossing
Change your SetEnvIf
line to this:
SetEnvIf Request_URI ^/(api|index\.php) noauth=1