Mod_ReWrite:不需要的重定向
Mod_Rewrite 正在重定向。
RewriteRule ^viewPage/([^/]+)/([^/]+)/$ /viewPage?ID=$1&Title=$2 [NC,L]
正在输入
www.domain/viewPage/123/abc/
正在返回
www.domain/viewPage.php?ID=123&Title=abc
我不希望页面从 www.domain/viewPage/123/abc/
重定向到 www.domain/ viewPage.php?ID=123&Title=abc
。
我该如何让它发挥作用?
Possible Duplicate:
.htaccess, Clean URL, unwanted 301 redirect, 1AND1
Mod_Rewrite is redirecting.
RewriteRule ^viewPage/([^/]+)/([^/]+)/$ /viewPage?ID=$1&Title=$2 [NC,L]
Typing in
www.domain/viewPage/123/abc/
is returning back
www.domain/viewPage.php?ID=123&Title=abc
I don't want the page to redirect from www.domain/viewPage/123/abc/
to www.domain/viewPage.php?ID=123&Title=abc
.
How do I get this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在 viewPage 末尾缺少
.php
,如果缺少,则 mod_rewrite 将再次匹配,并且匹配似乎有点限制性。Your missing the
.php
at the end of viewPage, mod_rewrite will be matched again if its missing also the matches seem abit restrictive.