Mod_rewrite 条件不起作用
我检查了正则表达式,它们都匹配,但由于某种原因它在 mod_rewrite 中不起作用?
我想要
http://www.system.com/chips/intel?c=xxx
阅读:
http://www.system.com/chips/intel/xxx
我有:
RewriteCond %{REQUEST_URI} (c=.*)$
RewriteRule (/([^/]+)/?).*?c=(.*) http://%{SERVER_NAME}/$1/$2/ [L]
我得到了一个错误。这是怎么回事?
I've checked the regexs and they all match but for some reason its not working in mod_rewrite?
I would like
http://www.system.com/chips/intel?c=xxx
to read:
http://www.system.com/chips/intel/xxx
I have:
RewriteCond %{REQUEST_URI} (c=.*)$
RewriteRule (/([^/]+)/?).*?c=(.*) http://%{SERVER_NAME}/$1/$2/ [L]
And I'm getting an error. What's going on here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的正则表达式与该 URL 不匹配。如您所见:
/chips/
chips
xxx
您可能想要类似的东西:
Your regular expression doesn't match that URL. As you have it:
/chips/
chips
xxx
You probably want something like:
不要认为 rewritecond get 是 uri 参数,除非你有“QSA”
http:// /httpd.apache.org/docs/2.0/mod/mod_rewrite.html
Don't think rewritecond get's the uri params unless you have "QSA"
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html