gpt4 book ai didi

Apache .htaccess : How to rewrite backslash with slash on Firefox?

转载 作者:行者123 更新时间:2023-12-01 04:13:22 26 4
gpt4 key购买 nike

如何重写反斜杠 '\'带斜线 '/'在 Firefox 上?

Chrome, IE, Safari, Opera 已经构建浏览器用斜杠重写反斜杠。
但是 Firefox 3.6.13 返回 404 错误页面。

# Why Firefox returns 404 error page?
RewriteCond %{REQUEST_URI} (.*)\\(.*)
RewriteRule .* %1/%2 [R=301,L]

最佳答案

这是 Apache 和 FF 的错误,https://issues.apache.org/bugzilla/show_bug.cgi?id=35256
希望它很快会在功能中得到修复。

  1. AllowEncodedSlashes should really be "on" by default and probably even deprecated. ...
  2. Nowhere the RFCs is a backslash (\) listed as a reserved character. Therefore a %5C
    should always be decoded the same as %7E is converted to a tilde (~).


要在 Apache 上解决它:
添加 AllowEncodedSlashes OnVirtualHost httpd-vhosts.conf 或 httpd.conf 和 .htaccess:
RewriteEngine On 
RewriteCond %{REQUEST_URI} ^(.*)\\(.*)$
RewriteRule .* %1/%2 [R=301,NC,L]

关于Apache .htaccess : How to rewrite backslash with slash on Firefox?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4887928/

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