Mobile app version of vmapp.org
Login or Join
Cooney921

: Getting 301 redirect error in Google Webmaster Tools while using "change address" So I'm moving my website from one domain to another. In this process I'm using the "change address" function

@Cooney921

Posted in: #301Redirect #GoogleSearchConsole #Htaccess

So I'm moving my website from one domain to another. In this process I'm using the "change address" function in Google Webmaster Tools on my old-domain.com, "switching" it to / choosing my verified new-domain.com.

In Step 2 of this process, Google Webmaster Tools will check whether 301 redirect is setup properly on old-domain.com... And it fails...

Translated to English it says: "Could not find any 301-redirect directives".

I've setup the 301 redirect on my old-domain.com in the .htaccess - and no other content is in the file than this:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^old-domain.com$ [NC]
RewriteRule ^(.*)$ new-domain.dom/ [R=301,L]


Am I missing something?

Note that the redirecting works perfectly

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

3 Comments

Sorted by latest first Latest Oldest Best

 

@Michele947

Make sure when you are adding a domain in Google Webmaster Tools, use the domain as example.com instead of example.com.
This will also cause 301 error when you revamp or migrate the site.

If you have already added example.com then also add this too example.com and verify it in webmaster tools.

10% popularity Vote Up Vote Down


 

@Vandalay111

Your htaccess is fine and mabye working, but the correct way is this:

RewriteCond %{HTTP_HOST} ^old-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.com$
RewriteRule ^(.*)$ "http://www.new-domain.com/" [R=301,L]


Because google will chek both www and non www protocols.

Once you make this change, please chek it if works fine with this tool: web-sniffer.net/
After you validate the step 2, I warn you, step 3 may fail depending on the validation method you had for webmasters tools. To resolve this, you will have to re-validate your old domain by using a configuration option in your DNS (acseso to your service ISP provider's option). Webmasters tools will give you a code when you choose that option, and will ask you to create a TXT record in your DNS settings.

Good luck!

10% popularity Vote Up Vote Down


 

@Ann8826881

Your .htaccess actually looks OK, and you say the redirection is working OK for you. The only possibility is that if Google is requesting the www subdomain? In this case, Google would not see the redirect since you are specifically checking for the bare domain.

Since your old-domain is a separate hosting account then your directives can be simplified (ie. no need to check the requested HOST, since it can only be old-domain anyway), and this will also capture the www subdomain (if that is indeed the problem)...

All that's required is:

RewriteRule (.*) new-domain.dom/ [R=301,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme