Redirect Subdomain of domain1 to subdomain of domain2

/Redirect Subdomain of domain1 to subdomain of domain2

Redirect Subdomain of domain1 to subdomain of domain2

For example if we need to redirect

x.domain1.com to x.domain2.com

y.domain1.com to y.domain2.com

and domain1.com to domain2.com

Use

#RewriteCond %{HTTP_HOST} ^(.*)domain1.com$ [NC]

#RewriteRule ^(.*)$ http://%1domain2.com/$1 [R=301,L]

but if we dont want to redirect domain1.com to domain2.com and only the subdomains then use

Use the following code

RewriteCond %{HTTP_HOST} ^(.*)\.sio-india\.org$ [NC]
RewriteRule ^(.*)$  http://%1.sio-india.com/$1  [R=301,L]
By | 2010-06-19T07:10:30+00:00 June 19th, 2010|htaccess, SEO, Subdomain|Comments Off on Redirect Subdomain of domain1 to subdomain of domain2