Reputation: 705
If I have a rule like this:
RewriteRule ^([A-Za-z0-9-]+)$ /$1.asp [QSA]
I can redirect domain.com/test to domain.com/test.asp
But there may be exceptions where I have a folder called test. How can I override my own rule with exceptions in that case?
Upvotes: 1
Views: 29
Reputation: 785376
You can use negative lookahead to create exceptions:
RewriteRule ^(?!test/)([a-z0-9-]+)$ /$1.asp [L,NC,QSA]
Now this rule will be skipped for any request URI that starts with /test/
Upvotes: 1