Share icon

Usually we develop the site on developement or subdomain and when we finally mirgate the to new domain then some of thing will remain or page redirect happens in  sometimes , so In this case .htaccess file helps to redirect all your olddomain pages to new one 

Below is the code will helps to redirect the olddomain to new domain, should be written in .htaccess file on your root folder

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^yourolddomain.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www.yourolddomain.com$
  RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>

Hopes this articles helps, thanks

Add new comment

Restricted HTML