lafif-a
2/4/2015 - 11:48 AM

[server] Rewrite old domain to new domain

[server] Rewrite old domain to new domain

#rewrite all subdomain on old domain to subdomain on new domain
RewriteCond %{HTTP_HOST} ^(.*)\.olddomain\.com$ [NC]  
RewriteRule ^(.*)$ http://%1.newdomain.com/$1 [R=301,L]

# rewrite all links to new domain
RewriteEngine on 
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]