.htaccess exception rules not working

Viewed 163

These are my current rules in .htaccess. Basically, I want to redirect my entire site from domain1.com to domain2.com except for the following conditions:

  1. all files/pages inside /offers folder

  2. the page at /page/company-a

When I access www.domain1.com/page/company-a, I am redirected to domain2.com/index.php instead.

Any advice appreciated.

RewriteCond %{REQUEST_URI} !^/offers
RewriteCond %{REQUEST_URI} !^/page/company-a

RewriteCond %{HTTP_HOST}  ^www\.domain1\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain2.com/$1 [L,R=301]


# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
1 Answers
Related