mod_rewrite 为 %26
我试图将像
“Lights+&+Lamps”
这样的类别名称作为参数传递,并使用我理解的重写规则
RewriteCond %{HTTP_HOST} example.com$
RewriteRule ^/category/([^/]+)$ /showproduct.pl?category=$1 [PT]
&是一个参数分隔符,但即使我传入:
“Lights+%26+Lamps”,
我的输出也是“Lights”,
所以 mod 重写会吃掉 %26 处的所有内容,
我尝试了不同的标志,如 [NE] 和 QSA,但没有成功。
有什么想法吗?
I'm trying to pass in as a parameter a category name like this
"Lights+&+Lamps"
with this rewrite rule
RewriteCond %{HTTP_HOST} example.com$
RewriteRule ^/category/([^/]+)$ /showproduct.pl?category=$1 [PT]
I understand & is a paramater separator, but even when I pass in :
"Lights+%26+Lamps"
My output is "Lights"
So mod rewrite is eating everything at %26
I've tried different flags like [NE] and QSA with no luck.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了类似的问题,其中“&”(&符号)被 mod_rewrite 错误地重写了。 B 标志解决了这个问题:
它允许我提供包含“&”的文件在他们的名字中,例如此处
你需要的是这个
I had similar problem where the '&'(ampersand) was incorrectly rewritten by the mod_rewrite. The B flag solved it:
It allowed me to serve the files containing '&' within their name, eg here
What you need is this
您可以在此之前使用另一个规则将
%
重写为%25
吗?Could you rewrite
%
to%25
with another rule before that?