将编码字符添加到 url 会破坏 htaccess

2024-01-01

这是我的代码:

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

当我访问时page/http://google.com/ http://google.com/_


我相信你需要B (escape http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteflags) flag:

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

这将在将反向引用 ($1) 添加到替换字符串之前对其进行转义。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

将编码字符添加到 url 会破坏 htaccess 的相关文章

随机推荐