i-CONICA
i-CONICA

Reputation: 2379

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.

Upvotes: 0

Views: 125

Answers (2)

naivists
naivists

Reputation: 33551

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

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799520

Put the rule for the feeds before the other rule.

Upvotes: 1

Related Questions