小编meg*_*off的帖子

排除受保护的子 URL 在 Apache 2.4 上不起作用?

我尝试从受保护的网站中排除子网址“/shop/api”。它在 Apache/2.2.15 上的不同服务器上运行良好,但现在不适用于 Apache/2.4.7?它总是要求进行基本身份验证。知道我做错了什么吗?

AuthType Basic
AuthName 'Authentication required'
AuthUserFile /var/www/vhosts/pwd/.htpasswd

# Allow access to excluded diretories
SetEnvIf Request_URI ^/shop/api/  noauth=1
Order deny,allow
Satisfy any
Deny from all
Require valid-user
Allow from env=noauth
Run Code Online (Sandbox Code Playgroud)

.htaccess http-basic-authentication apache-2.4

8
推荐指数
1
解决办法
6342
查看次数