gpt4 book ai didi

mod-rewrite - 无法匹配 mod_rewrite 中的 %2F

转载 作者:行者123 更新时间:2023-12-01 16:11:28 26 4
gpt4 key购买 nike

我有一组重写规则(在 .htaccess 中),如下所示:

RewriteRule ^list/vendor/(.*)$ list.php?vendor=$1
RewriteRule ^list/product/(.*)$ list.php?product=$1
RewriteRule ^list/(.*)$ list.php?search=$1

(不过,我认为前两个与我的问题无关)。

当我输入 myserver.com/list/foo%2Cbar 甚至 myserver.com/list/foo/bar 时,我得到了我期望的结果:list .php 通过 $_GET['search'] 中的 foo,barfoo/bar 调用。

但是如果我输入myserver.com/list/foo%2Fbar,似乎规则不匹配!相反,我收到 404 错误。这里会发生什么? Apache 2.2.14,如果重要的话。

(我在 Firefox 和 Chrome 中尝试过,结果相同 - 当然,这可能是浏览器出现问题)。

最佳答案

啊,我找到了... Apache 选项 AllowEncodedSlashes ,不能按目录或从 .htaccess 设置,默认情况下处于关闭状态。

如果我无法让托管人员在我的虚拟服务器中打开它,则需要构建解决方法时间。

关于mod-rewrite - 无法匹配 mod_rewrite 中的 %2F,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7544759/

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