A site I'm developing for a client has an international audience. Because of that, upon first visiting any site that depends on location (for price lists, availability of products, etc.) if no locale is set, the user is requested to select where they are located.
unfortunately, this has the adverse effect of also prompting Google and other search engines to set their locale. i know this cause I've viewed cached versions of the site at Google.
is there a way of knowing whether or not it's a bot or spider visiting the site and if so, defaulting to a specific locale?
links to examples welcome.
cookies and Google
Moderator: General Moderators
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
I do something like this to send bots to a different stats file ..
Code: Select all
<?php
$st_remote_host = @getHostByAddr($REMOTE_ADDR);
if((strpos($st_remote_host, "google")) OR (strpos($st_remote_host, "teoma")) OR (strpos($st_remote_host, "alexa")) OR (strpos($st_remote_host, "inktomisearch"))== true) {
// this is where I do whatever, you could probably do a header to a different page for bots
}
?>-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC