mod_rewrite, Adding a Condition
A A’s Question:
I have this .htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)$ zone.php [L]
Right now it works pretty well. How can I make this RewriteRule not work in a certain directory?
I do not want the rule to work for anything in domain.com/manage/
Change your code with this:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule (?!^manage/)^.*$ /zone.php [L,NC]
Add a condition by using the RewriteCond
keyword to apply the rule if the directory is not manage
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/manage(/|$)
RewriteRule ^(.*)$ zone.php [L]