Page 1 of 1

cookies and Google

Posted: Mon Nov 24, 2003 11:29 am
by microthick
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.

Posted: Mon Nov 24, 2003 3:30 pm
by tsg
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
}
?>

Posted: Mon Nov 24, 2003 4:31 pm
by microthick
thanks tsg. i'll look into that idea.

Posted: Mon Nov 24, 2003 5:23 pm
by microthick
The only problem I have with tsg's approach is that I have to maintain a list of bots that visit my page.

Is there any way to distinguish a normal visiter from a spider?