谁能告诉我为什么这不起作用?
我尝试了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>
谢谢!
试试这个:
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