PHPMatters Help You Better Hosting Your PHP-based Sites
How to Move to New Domain without Affecting SEO

How to Move to New Domain without Affecting SEO

It might be happening that you want to change the domain name of your website in the future. Moving to a new domain is easy as you only need to backup the site and transfer all the contents, but switching to a new domain name without affecting SEO is not a simple task that requires a strategic practice. In the following, we’d like to tell you how to do this intelligently by making use of some powerful tools.

Before Starting Migration

Many webmasters have dozens of reasons of why they move their mature website to a new domain, such as they want to rebrand their sites or they find the domain they currently use is too narrow-focused. However, few of them realize that this practice can have a negative impact on their search engine rankings. If you fail to carry out the migration carefully, you might be losing all the authority and popularity you have built on the site permanently.

Before Migration

Generally, search engines utilize some special metrics and characteristics to determine the overall ranking of a website. All of these statistics are linked to your domain, so if you switch to a new one, the data will be reset to zero, thus affecting your rankings as search engines need time to adjust to the changes.

In fact, this impact is normal, happening to all the sites changing the domain name. Thus, there is no need to worry about this, but the core is to decrease the negative SEO effects and keep the effects temporarily within a short period of time.

Move to a New Domain

to-do listOnce you have your new domain name setup for, you now need to backup and transfer your website. The whole process requires five steps that are listed in the following.

  • Step one: Download and back up of your website using the FTP client. As the root directory of public_html contains all the files and folders needed to make the site work properly, you’d better make sure that nothing has been left.
  • Step two: Upload all the downloaded files to your new website. Note that you need to locate them at the root folder, and maintain the same directory structure.
  • Step three: Back up and export the database from the old domain using phpMyAdmin that can be found from your control panel. After logging in, simply select the target database and choose the export option. Don’t forget to save the backup file with the gzipped format.
  • Step four: Create a new MySQL database and import the saved database file. All of these can be done easily with the help of phpMyAdmin. Here, we suggest you to give the newly-created database the same database name along with a user featuring the same username and password as the database for the old domain.
  • Step five: Figure out and replace all the instances of the old URL with a new domain name in every table of the database, such as settings, pages, and posts. Besides, you’d better do the same thing in your .htaccess file in case the old domain related occurrences are hard-coded.

In fact, you can also move your website with some powerful tools that can clone, backup and transfer the entire site from one domain name to another.

Minimize SEO Impacts

Search engine optimization is undoubtedly critical. We have introduced some SEO related guidance previously, and now, the use of 301 redirection can come into play.

You have moved your whole site from the old domain to the new one successfully, and the next thing to do is setting up permanent 301 redirects to lead visitors and search engines to your current website. This step is very important as it tell everyone that your site has permanently moved.

In fact, the HTTP response status code of 301 is used for permanent redirection, meaning that the current links included in your site should be updated to a new URL. Honestly speaking, from the SEO perspective of view, the 301 redirects are capable of passing through the link juice of any links pointing to the old domain to the new domain, without losing the search engine rankings.

The 301 redirects can be added through the .htaccess file if you are using a Linux server. The needed lines of code are as following.


If you are the user of a Windows server, you can do this through the web.config file or IIS. Whatever the server you are using, the core is that you need to ensure that every page of the old site is directed to the corresponding one on the new site.

Inform Search Engines and Visitors of the Migration

In fact, you now can be directed to your new domain automatically if you enter the old domain name, but you still need to notify the changes to both search engines and visitors manually.

  • To search engines – There is a Google tool available called Google Webmaster Tools. This tool can tell search engines you have moved to a new domain. You can do this using its Change of Address feature.
  • change address

  • To visitors – You can notify your visitors by making a public announcement. For instance, you can create a standard blog post on the new site explaining that you have moved to a new domain, or create a switching page with the migration message attached.