htaccess ile (denemedim ancak çalışır diye düşünüyorum)
Alıntı
RewriteCond !%{HTTP_USER_AGENT} (googlebot) [NC]
RewriteRule ^ - [L]
php ile aşağıdaki kodu kullanarak google botları tespit edebilirsin.
<?php
function botDetect()
{
$bots_list=array(
"Google"=>"Googlebot",
//"Yahoo"=>"Slurp",
//"Bing"=>"bingbot"
/*You can add more bot here*/
);
$regexp='/'. implode("|", $bots_list).'/';
$ua=$_SERVER['HTTP_USER_AGENT'];
if(preg_match($regexp, $ua,$matches))
{
$bot= array_search($matches[0], $bots_list);
return $bot;
}
else
{
return false;
}
}
?>