0

I have a Mod_Rewrite setup as follows:

RewriteCond %{REQUEST_FILENAME} !^/www/live/site.name/app/public/(/forms/|/crm/)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]

Routing all requests - except for the /forms/ and /crm/ folder through an index.php file which loads the framework/routing etc.

However, now I have to allow /forms/apply/ to also be routed to the index.php - but anything else in /forms/ should continue to be ignored.

Any suggestions?

1
  • Do the rules work currently? Because I'd assume that the pattern public/(/forms/|/crm/) has one too many / character.
    – hjpotter92
    Oct 31, 2015 at 7:56

1 Answer 1

0

You can use the OR condition:

RewriteCond %{REQUEST_FILENAME} ^/www/live/site\.name/app/public/forms/apply/ [OR]
RewriteCond %{REQUEST_FILENAME} !^/www/live/site\.name/app/public/(forms/|crm/)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]

By the way . need to be escape, and you had a / in more in /forms/ & /crm/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .