开发者

mod_rewrite rule: if URL contains a certain string

开发者 https://www.devze.com 2022-12-21 21:02 出处:网络
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:

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-a开发者_如何转开发rtists [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!


Try this:

RewriteCond %{REQUEST_URI} !/noticeboard2\.php$
RewriteRule noticeboard noticeboard2.php?section=studios&subSection=studio-artists [L]

This rule will rewrite any request that contains “noticeboard” in the URL path to noticeboard2.php in the same directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号