1
Vote

There is a problem to parse [OR] flag

description

Please consider the following Rules:
RewriteCond %{HTTP_HOST} ^www.domain2.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^domain2.com$ [NC]
RewriteRule (.*) http://www.domain1.com$1 [R=301,L]
This rules must redirect http://www.domain2.com or http://domain2.com to http://www.domain1.com.
But it redirects only for http://domain2.com.

I think the following line causes this problem (Because second RewriteCond has not [OR] flag):
rewriteCond = orNext ? rewriteCond || match : rewriteCond && match;
Also please be aware that in .htaccess correct syntax for last line is: (Slash before $1)
RewriteRule (.*) http://www.domain1.com/$1 [R=301,L]

comments