Reputation: 27
This is my current RewriteRule: RewriteRule ^products(/.)$ products.php I would like it to rewrite for products/anything but not for products/shopping-cart I'm not sure how to do this.
Upvotes: 0
Views: 28
Reputation: 41848
Like this:
RewriteRule: RewriteRule ^products(?!/shopping-cart)(/.)$ products.php
(?!/shopping-cart)
is a negative lookahead that ensures that what follows is not /shopping-cart
As @anubhava points out, (/.)
looks suspicious. What you want is probably either (/?)
(to match an optional /
) or (/.*)
to match the tail end.
Reference
Upvotes: 1