Prevent Googlebot from following JavaScript redirect

Prevent Googlebot from following JavaScript redirect - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Prevent Googlebot from following JavaScript redirect error on your web browser. Problem :


I run a website called isitsnowingoutside.com as kind of an experimental project. As I am still learning- it is far from perfect. The basic premise is the site uses your location to determine if it is snowing.



Currently I have it setup to use the new javascript geolocation. If the user denies access to that or it simply doesn't work there is javascript redirect that will forward the user to a page where I attempt to find their location by IP address. Currently I have the javascript redirect wait 10 seconds.



Unfortunately, when google indexes my site it follows that redirect and the search results display the url for Mountain View- not my homepage. I tried adding no-index to the subpages in my site but now it just doesn't show up in the results at all. Any ideas?


Solution :

Watch this video by Matt Cutts or read it here.



So if Googlebot comes in, you check the IP address, and imagine we’re
coming from the United States, just redirect Googlebot to the United
States version of the page, or the dot-com, or whatever it is you
would serve to regular United States users. So geolocation is not
spam."


But. as long as you’re treating Googlebot just like every other
user, whatever IP address they come from when you’re geo-locating, as
long as you don’t have special code that looks for the user agent of
Googlebot or special code that looks for the IP address of Googlebot
,
and you just treat Googlebot exactly like you would treat a visitor
from whatever country were coming from, then you’ll be totally fine.



This is what I would suggest to do :


Have the code for detecting location and showing the result on the home page itself. In this way, GoogleBot won't get redirected to some other page and will show your home page in search results instead of the page for Mountain View.


If you want all the other pages specific to a place to get indexed, you can list the links to all of them on a single page which Google can index.


We hope that this article has helped you resolve the seo, redirects, googlebot error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=