Redirect all traffic to new domain name – 301 Redirect

0

Sometimes you want to redirect all traffic from old domain name to new domain name without losing search traffic. The right way is here:

You will need to edit your htaccess file in your web hosting account, and enter this line of code:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^OLDDOMAIN.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.OLDDOMAIN.com [NC]
RewriteRule ^(.*)$ http://NEWDOMAIN.net/$1 [L,R=301,NC]

Replace old domain to your old domain name from where you want to send traffic, and replace newdomain to your new domain name where you want all your traffic.

Save the file and enjoy. Hope you will take backup of your website before executing the above job because sometimes things get bad.

-After Content-

Leave A Reply