mod_rewrite规则:如果URL包含某个字符串
我的客户不断编辑网站中的导航结构,这导致了一些 mod_rewrite 问题。我如何制定此规则:
RewriteRule ^studios/about-studios/artist-noticeboard noticeboard2.php?section=studios&subSection=studio-artists [L]
如果网址包含“noticeboard”,则该规则有效?像这样:
RewriteRule ^IF CONTAINS 'noticeboard' noticeboard2.php?section=studios&subSection=studio-artists [L]
欢迎任何指点!
My client keeps editing the structure of the navigation in the website, which is leading to some mod_rewrite issues. How could i make this rule:
RewriteRule ^studios/about-studios/artist-noticeboard noticeboard2.php?section=studios&subSection=studio-artists [L]
to work if the url contains "noticeboard"
? Like this:
RewriteRule ^IF CONTAINS 'noticeboard' noticeboard2.php?section=studios&subSection=studio-artists [L]
Any pointers welcome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试一下:
此规则会将 URL 路径中包含“noticeboard”的所有请求重写为同一目录中的 noticeboard2.php。
Try this:
This rule will rewrite any request that contains “noticeboard” in the URL path to noticeboard2.php in the same directory.