Changing Website Domain without Losing Google Ranking

Tara Prasad Swain PHP, SEO, WordPress

The reason of domain change could be anything but that’s a serious decision for your business especially when your site has good ranking.

In this article I will explain how to change your website domain name without losing SEO ranking.

301 is everything and plays the major role. If you want to know more about 301 redirection status please check my previous article When to use 404, 301 and 302 HTTP status code.

Analyze Current Domain and Indexed URLs.

To know the pages linked in Google, use below search criteria.

Site: DomainA.com

This will list the indexed pages on Google

Clone the Current Website to new Domain

Try to keep the same URL structure wherever possible. Check the site on new domain and ensure that all pages and links are functioning properly.

Organize events to let the audience know and tell Google that you moved to new domain.

On the current domain create a .htaccess file and put below code. Make sure that the redirection is 301 so Google will know that you have been moved to a new domain.


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

In the above example you are moving from DomainA.com to DomainB.com. That will redirect to new domain with exact same URL structure.
If you have some pages with URL change, you can add below to the .htaccess file.


<IfModule mod_rewrite.c>
RewriteEngine On

#Example current domain about.html changed to about-us.html in new domain
RewriteRule ^about.html http://DomainB.com/about-us.html [R=301,NC,L]

RewriteCond %{HTTP_HOST} ^DomainA.com [NC]
RewriteRule ^(.*) http://DomainB.com/$1 [R=301,NC,L]
</IfModule>

In the above example current domain about.html will redirect to about-us.html page in new domain.
You can monitor all the links of current website and ensure all links redirecting to new domain with respective URL without any 404 status.

The important thing is to keep the current domain and hosting active until all the new domain pages are properly indexed.

Hope this helps.

Share this Post