简体   繁体   中英

Mod_rewrite, how to stop rule applying to one query string?

I have a list of rewrite rules, but one of the rules is applying to something I need it to not apply to.

Here is the rewrite rule causing the problem,

RewriteRule ^([^/]*)/$ /category.php?category=$1 [L]

It's meant to rewrite .com/catname/ to /category.php?category=catname which it does fine, but I need it to not apply to anything beginning with /feed/, as these aren't handled by category.php. I have this rule for the feeds, but it's not getting a chance to do it's thing...

RewriteRule ^feed/([^/]*)/$ /feed/?cat=$1 [L]

Can anyone help?

Thanks.

将提要的规则放在另一个规则之前。

What is the sequence of your rules? You should put the /feed/ rule as first one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM