Answer the question
In order to leave comments, you need to log in
How to make an exception in mod_rewrite?
I have the following instruction in .htaccess:
Simply put, I direct all site.com/sometext requests to site.com/page.php?s=sometext
But if I have a directory called "sometext" in the root of the site, then the redirect will work on a crooked url:
site.com/sometext/?s=sometext
How can I write exceptions for one or two directories? RewriteRule ^([A-Za-z0-9-]+)$ page.php?s=$1 [PT]
Answer the question
In order to leave comments, you need to log in
The line below is inserted before the RewriteRule and allows you not to process the address value starting with /res/
You can write the second directory in the same form below, and so for all exception options, or tie regexps.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question