Sometimes you need to move your website from existing domain to a new one. Also, you might have already set up a property in Google Search Console for existing website. Then in case of the domain change, you require to create a new property for the domain. Additionally, you also need to redirect old URLs to new as well as inform Google through Search Console about this address change.
Suppose you are planning to redirect a website from the domain oldsite.com to newsite.com. Additionally, both URL schemes are identical except the name of domains. Here, we are explaining how can you properly set up redirection. By properly means, not losing the rankings your website has earned through old URLs in Google Search results.
Redirect Old URLs to New and Change Address in Search Console – Why
To be honest, setting up proper redirection is more important than informing Google through Search Console. However, you already have a property set up at the console and you’re going to add a new. So you should tell Google about this website address change in the old property.
If both of the domains are accessible then it will raise the duplicate content issue. It will further adversely affect your website’s rankings and Search Result appearance. So it’s better to keep only one domain to serve web pages and redirect old URLs to new.
Also, saving your link juice is the most important. There might be many websites that would be referencing your old pages. These references are links that create weights to let your pages appear higher in Search Results. Don’t let them go.
Furthermore, just a redirection is not enough. You need to tell that the old page has been moved to this new page in the new domain. In other words, use of an adequate HTTP response code 301 (moved permanently). We will add and process proper redirect rules in accordance with the Google Search Console.
Google has provided a dedicated tool named Change of Address in the Console. We will use that tool to process the domain address change of the website.
Set up the Website using the New Domain
First of all, just set up the new domain like you set up a new website. The only difference is you have to use content from the old domain. Forget the old website for a while and treat it like a new one. Take care to update all old links, content or whatever you want to update.
Now access the website by typing the new domain URL in the browser address bar. It should load fine else Google’s tool won’t work. If the new URLs are loading pages fine then congratulations. You have completed the most tedious task successfully. Now let’s set up the redirection from the old domain to the new.
Redirect Old URLs to New
If you’re using Apache then open the .htaccess file of your old domain. This is a hidden file and you can show it using the option provided by the FTP program. There should be a line RewriteEngine On present in the file.
Put the following rewrite conditions and rule directly below that mentioned line to redirect old URLs to new:
1 2 3 | RewriteCond {HTTP_HOST} !^www.newsite.com$ RewriteCond %{REQUEST_URI} !^/googleverification.html RewriteRule ^(.*)$ https://www.newsite.com/$1 [R=301,L] |
Also, you might need to change these lines slightly. Remove www. from the first line if your new domain’s URL is a non-www version. Similarly, replace https to http and/or remove www. as per your new domain’s preferences in the last line.
The following two articles will help you to set up correct rules among www, non-www, HTTP and HTTPS:
Additionally, you will have to replace googleverification.html with the actual file name in the second rule. You will receive this file from Google Search Console during the address change process. Or replace the file name if you already have the file uploaded to the server.
Of course, don’t miss to replace newsite.com with the actual new domain name. Also, note that instead of just RewriteEngine On, the old domain’s .htacess might have these two lines:
1 2 | RewriteEngine On RewriteBase / |
In such case, place those three given rules direct after the second line. Now visit any URL from the old domain. This will redirect you to the same path in the new domain.
Change Address in Google Search Console
Till here, you have done redirection of old domain URLs to new domain’s URLs. Now it’s time to update Google about this domain change for proper indexing of new URLs. Google has recently launched a new version of Search Console. However, the Change of Address tool is available in the old version at the time of writing the article.
Set up new property for the website on the new domain using either version of the Search Console. The new version has the Add Property option inside the drop-down located at top-left. After creation, verify the property ownership using your preferred option.
Now go back to old version of the console using Go to the Old version menu at bottom-left. Then select the old domain property first from the drop-down at top-right. Further, click to the gear icon right to the drop-down and select Change of Address.
Here, you will have to process four steps. Additionally, once you will complete a step, a green right tick will appear at the right of the step. Otherwise, if something goes wrong then a red cross mark will appear.
1. Pick your new site from the list
This field will populate automatically else select the new domain property you just added.
2. Confirm that 301-redirects work properly
Recall the .htaccess here again. If the rule in the third line is working then this step should have a green tick. Click to the Check button to pass this step.
3. Check that verification methods are still present
This step is a little tricky. Even you have already verified the old domain ownership, there is a need to do it again. The verification should be still present in the old domain even you redirect old URLs to new. For the same, we had added first two redirect conditions in the .htaccess.
If you have previously verified the domain ownership using the HTML file upload method then this step should pass. But don’t forget to replace the file name in the .htaceess rewrite rule. Else, first click to the gear icon to the top right and select Verification Details from the drop-down.
Click Verify using a different method link in the page opened. Then verify the old domain again using HTML file upload again. Follow these steps:
- Download the file from the Search Console.
- Upload the file at document root for the domain or website.
- Match the HTML file name with the .htacess rule.
- Access the file using a browser, URL would be like http://oldsite.com/googleverification.html.
Of course, the file should be accessible using the old domain URL now. If everything is working fine then go back to the Change of Address tool. Pass step 1, 2 and 3 now to redirect old URLs to new in accordance with Google Search Console.
4. Submit the change of address request
Once all the checks pass, submit the request to change the address and index new pages. Google will take care of shifting all the rankings from the old domain to the new one.
Here, we have covered two topics. First, redirect old URLs or domain redirection along with proper 301 response code. Second, submission of an address change request to Google Search Console. It will preserve existing rankings of our website in Search Results while indexing the new domain.
Hope this article has helped you properly setting up redirection as well as informing Google. Like this post or has a question? Do update us through the comment form given.