.htaccess调试需要expr

时间:2019-05-27 18:29:47

标签: apache .htaccess

我正在尝试允许对特定网址的所有请求,以便将Webhooks发送到开发平台。要求expr部分起作用。

该网站应仅对特定用户完全可用。使用 "Require expr %{REQUEST_URI} =~ m#^.*webhook.*$#"我正在努力解决这个问题。我还尝试过LocationMatch,该方法在其他情况下不起作用。

AuthType Basic
AuthName "Please enter password"
require group xy yz

<IfModule mod_authz_core.c>
    <RequireAny>
        Require expr %{REQUEST_URI} =~ m#^.*webhook.*$#
        ...
    </RequireAny>
</IfModule>

如果我调用网址example.com/webhook/xyz/,则请求不会被接受,并返回领域登录信息。

日志:

[Mon May 27 20:15:58.972495 2019] [authz_core:debug] [pid 15344] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:50341] AH01626: authorization result of Require group xy yz: denied (no authenticated user yet)
[Mon May 27 20:15:58.972519 2019] [authz_core:debug] [pid 15344] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:50341] AH01626: authorization result of Require expr %{REQUEST_URI} =~ m#^.*webhook.*$#: granted
[Mon May 27 20:15:58.972526 2019] [authz_core:debug] [pid 15344] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:50341] AH01626: authorization result of <RequireAny>: granted
[Mon May 27 20:15:58.972813 2019] [authz_core:debug] [pid 15344] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:50341] AH01626: authorization result of Require group xy yz: denied (no authenticated user yet)
[Mon May 27 20:15:58.972824 2019] [authz_core:debug] [pid 15344] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:50341] AH01626: authorization result of Require expr %{REQUEST_URI} =~ m#^.*webhook.*$#: denied
[Mon May 27 20:15:58.973126 2019] [authz_core:debug] [pid 15344] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:50341] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
[Mon May 27 20:15:58.973154 2019] [auth_basic:error] [pid 15344] [client xxx.xxx.xxx.xxx.47:50341] AH01614: client used wrong authentication scheme: /router.php

我真的不知道他为什么拒绝了这个请求。也许重定向? PHP说,在尝试授予我的IP地址后,$ _ SERVER ['REQUEST_URI']仍然相同。因此,我想这不是重定向问题。知道什么会导致该问题或如何进行调试吗?

0 个答案:

没有答案