PDA

View Full Version : The Googlebot and Sessionid's


LanciaStratos
01-16-2003, 04:14 AM
Dontom posted (http://www.vbulletin.com/forum/showpost.php?postid=396411&postcount=42) the following code over at vB.com, and I want to use it on my forums to set the sessionid to null when the http-user-agent is the Googlebot, so Google won't have any trouble crawling my forum pages.


if (eregi("googlebot",getenv("HTTP_USER_AGENT" )) || eregi("internetseer",getenv("HTTP_USER_AGENT" )) || eregi("WebCrawler",getenv("HTTP_USER_AGENT" ))) {
$session = NULL;
}



Now, before I go off adding this to my forum, my question is, will this code actually do the job, and where should I insert this code to get the job done?

TECK
01-16-2003, 05:26 AM
Why go to all this trouble? It would take you a large line to enter all HTTP_USER_AGENT's for all search engines. :)
An easier solution is this:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=47667

LanciaStratos
01-16-2003, 02:45 PM
That's an awesome hack, but I don't want the search engine visitors to get lost in an archive when they come to my site - I want them to be using the real thing.