We have 2 subdomains www.mydomain.com
and www2.mydomain.com
. I'm trying to redirect pages to new site as below:
www.mydomain.com/support to newdomain.com/site1/page1.html
www2.mydomain.com/support to newdomain.com/site2/page2.html
I've set the redirect rule in httpd.conf
as below:
RewriteCond %{HTTP_HOST} (www.)?mydomain.com
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/support/?$ http://newdomain.com/site1/page1.html [R=301,NC,L]
RewriteCond %{HTTP_HOST} (www2.)?mydomain.com
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/support/?$ http://newdomain.com/site2/page2.html [R=301,NC,L]
The first redirect rule is working fine, but not the other. In above case, both www
and www2.mydomain.com/support
are going to newdomain.com/site1/page1.html
Any help is appreciated!