Welcome to WebmasterWorld Guest from 54.146.248.111

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Start a session only for human browsers

A script you might find handy

     

Nick_W

9:52 am on Jun 10, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



After a few discussions on the propagation of SID's through the url when cookies are not turned on and how this can lead to duplicate content issues with some SE's I sat down and wrote this:

Maybe you'll find it useful or be able to improve on it....


<?
/* Use this to start a session only if the UA is *not* at search engine
to avoid duplicate content issues with url propagation of SID's */

$searchengines=array("Google", "Fast", "Slurp", "Ink", "ia_archiver", "Atomz", "Scooter");
$is_search_engine=0;
foreach($searchengines as $key => $val) {
if(strstr("$HTTP_USER_AGENT", $val)) {
$is_search_engine++;
}
}

if($is_search_engine==0) { // Not a search engine

/* You can put anything in here that needs to be
hidden from searchengines */
session_start();

} else { // Is a search engine

/* Put anything you want only for searchengines in here */
$foo=$bar;

}

?>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month