任何人都可以告诉我为什么这不起作用?
我尝试过Request_URI的变体,例如%{REQUEST_URI}。我尝试过不同的正则表达式,我尝试将setenv放在文件部分中,但没有一个有效。
RewriteEngine On
SetEnvIf Request_URI ^/support/ REDIRECT_noauth=1
RewriteCond %{REQUEST_URI} !^/other
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
<Files "index.php">
AuthUserFile *****/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
AuthName "Login"
Order Deny,Allow
Satisfy any
Deny from all
Allow from env=REDIRECT_noauth
Require valid-user
</Files>
谢谢!
答案 0 :(得分:0)
试试这个:
SetEnvIfNoCase Request_URI ^/support/ REDIRECT_noauth
AuthUserFile *****/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
AuthName "Login"
Order Deny,Allow
Satisfy any
Deny from all
Allow from env=REDIRECT_noauth
Require valid-user