mod_rewrite 仅特定网址
mod_rewrite 是我最大的敌人,我一生都无法弄清楚出了什么问题,所以废弃了我拥有的所有 htaccess 内容,希望你们这些聪明的傻瓜可以帮助一个愚蠢的傻瓜!
我们只想重写 3 个链接,因此它只会影响这些链接。
index.php?portfolio=print
。
portfolio/print
然而
index.php?portfolio=branding
希望它影响
portfolio/branding
我不
index.php?portfolio=illustration]
链接
portfolio/illustration
像index.php?portfolio=photography这样的
所以理想情况下我猜 3 行有 3 条规则,只重写那些链接,基本目录是 /new/。
希望你们能帮忙:)
再次感谢!
欧文
mod_rewrite is my worst enemy and cant for the life of me figure out whats going wrong, so scrapped any htaccess content i had in hope you clever fools can help a dumb fool!
we only want 3 links re-written so it only effects these.
index.php?portfolio=print
into
portfolio/print
and
index.php?portfolio=branding
into
portfolio/branding
and
index.php?portfolio=illustration]
into
portfolio/illustration
however i dont want it to effect links such as index.php?portfolio=photography.
so ideally i guess 3 lines with 3 rules that re-write only those links, the base dir is /new/.
hope ya guys can help :)
thanks again!
Owen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这将与您使用具有2个假设的一条规则所描述的内容相匹配 - 没有尾随斜杠或查询字符串参数。
如果您希望在 URL 中出现任何一个,请评论回来。您可以通过将其附加到捕获来非常轻松地添加另一个部分。
This will match what you describe using one rule with 2 assumptions - no trailing slash or query string parameters.
Comment back if you expect either in the URLs. You can add another section very easily by appending it to the capture.