Friday, December 13, 2024
HomeEntertainmentRedirect all traffic to new domain name - 301 Redirect

Redirect all traffic to new domain name – 301 Redirect

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.

Sunil Butolia
Sunil Butoliahttps://www.duloit.com/leadership/sunil-butolia.html
Sunil Butolia is an independent journalist, chief editor of FAMEPublish.com. He is the founder and CEO of Duloit Technologies.
RELATED ARTICLES
- Advertisment -

Most Popular