We have a site where multiple domain names are being condensed and 301 redirected to a single new domain name. I am testing all of our 301 redirects and am having problems with instances where the page name is identical but the domain name is different. For example:
# EXAMPLEA.COM
RewriteCond %{HTTP_HOST} ^(www\.)?examplea\.com$ [NC]
RewriteRule ^default.aspx$ http://newdomain.com/new-page-a/$1 [R=301,L]
# EXAMPLEB.COM
RewriteCond %{HTTP_HOST} ^(www\.)?exampleb\.com$ [NC]
RewriteRule ^default.aspx$ http://newdomain.com/new-page-b/$1 [R=301,L]
Currently, whichever domain comes first in my .htaccess file is the one that wins. This makes no sense to me because I have conditions in there for HTTP_HOST
. Why would http://exampleb.com/default.aspx
qualify for the first rewrite rule?