我想请求uri / admin然后.htacccess
受保护的密码answer
然后允许来自/ admin
此代码无效
SetEnvIf Request_URI ^/admin require_auth=false
AuthType Basic
AuthName "Staging Server"
AuthUserFile /system/pw/.htpasswd
Require valid-user
Order allow,deny
Deny from env=require_auth
Satisfy any
Allow from env=!require_auth
答案 0 :(得分:0)
#allows a single uri through the .htaccess password protection
SetEnvIf Request_URI "/admin" test_uri
#allows everything if its on a certain host
Order Deny,Allow
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /system/pw/.htpasswd
#Allow valid-user
Deny from env=test_uri
Satisfy any
Require valid-user