gpt4 book ai didi

php - Apache 2.4 .htaccess 通过 Request_URI 绕过基本身份验证

转载 作者:行者123 更新时间:2023-12-02 04:27:43 25 4
gpt4 key购买 nike

我有一个使用 Silex 运行的 PHP 应用程序,它受到基本身份验证的保护,但我需要应用程序的一部分不要求输入密码。我可以在 Apache 2.2 中执行此操作,但似乎不适用于 2.4。这是我的 .htaccess

SetEnvIf Request_URI ^/register noauth=1
AuthType Basic
AuthName "Auth"
AuthUserFile /path/to/.htpasswd
Order Deny,Allow
Satisfy any
Deny from all
Require valid-user
Allow from env=noauth

我知道 Apache 2.4 有不同的方法来做到这一点,有人知道怎么做吗?

最佳答案

如果有人感兴趣,我是这样修复的:

SetEnvIf Request_URI /register noauth=1
AuthType Basic
AuthName "Auth"
AuthUserFile /path/to/.htpasswd
<RequireAny>
Require env noauth
Require valid-user
</RequireAny>

关于php - Apache 2.4 .htaccess 通过 Request_URI 绕过基本身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25732982/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com