添加连接codeD字符的URL休息htaccess的字符、codeD、htaccess、URL

2023-09-02 09:45:48 作者:谁伴我闯荡

下面是我的code:

RewriteEngine on
RewriteRule page/(.*) index.php?url=$1 [NC]

在我访问的页/ HTTP://google.com/ 的=工作得很好 当我访问的页/ HTTP%3A%2F%2Fgoogle.com%2F 的=服务器报告404

When I access page/http://google.com/ = works just fine When I access page/http%3A%2F%2Fgoogle.com%2F = server reports 404

马尔蒂·莱恩

推荐答案

阿帕奇返回一个(有点不直观)的情况下,404当你有恩codeD斜杠的请求,但没有的 AllowEn codedSlashes 设置为开。为了证实这一点的话,请检查您的错误日志,其中可能包含这样一个条目:

Apache returns a (somewhat non-intuitive) 404 in cases when you have encoded slashes in the request, but do not have AllowEncodedSlashes set to on. To confirm this is the case, check your error log, which likely contains an entry like this:

发现%2F(EN codeD'/')的URI   (德codeD ='/网页/ HTTP://google.com/),   返回404

found %2f (encoded '/') in URI (decoded='/page/http://google.com/'), returning 404