Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Here is the answer: webmasterworld.com/google/4640390.htm – AgA Jan 31 '14 at 7:02
i'm sure if you display different content to googlebot then normal customers this would be classed as cloaking – Liam Sorsby Jan 31 '14 at 12:41
up vote 0 down vote accepted

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.

share|improve this answer
I don't know why I hadn't thought of that. Thanks! – Zane DeGraffenried Jan 31 '14 at 15:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.