mod-rewrite 正则表达式有什么问题?
我正在尝试将
tagged.php?flag=parameter&page=1
重写为
/parameter/?page=1
所以我使用:
RewriteRule Hotties/?(.*) tagged.php?flag=parameter&page=$1
但是我得到的结果是:
/parameter/?page=
哪个是“1”。我不确定缺少什么。显然问题出在 (.) 和“=”上,但我不确定出了什么问题。我也尝试过 (.$) 但没有解决它。
I am trying to rewrite
tagged.php?flag=parameter&page=1
into
/parameter/?page=1
So I am using:
RewriteRule Hotties/?(.*) tagged.php?flag=parameter&page=$1
However the result I am getting is:
/parameter/?page=
Which is the "1". I am not sure what is missing. Clearly the issue is with the (.) and the "=" but I am not sure what is wrong. I also tried (.$) which did not fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 文档,您需要匹配 URL 路径和单独的查询字符串。如果这确实是你的问题
然后你会使用
,但我怀疑你实际上想反其道而行之,在这种情况下你会使用
Not确定“辣妹”这个词是从哪里来的。
According to the documentation, you need to match against the URL path and the query string separately. If this is really your question,
then you'd use
but I suspect you actually want to go the other way around, in which case you'd use
Not sure where the "Hotties" thing comes into it.