block web crawler
//解析進入網站的瀏覽器版本
$browser = $_server['HTTP_USER_AGENT'];
//將不想顯示內容的網路爬蟲加入
$reptile = array(
'Googlebot' , // google爬蟲
'Yahoo! Slurp' , //雅虎爬蟲
'msnbot' // bing爬蟲
'baiduspider'//
'Naverbot' //
'seznambot' //
'teoma' //
'Yandex' //
'Yeti' //
'*' //
);
//進行判斷比對,如有出現為設定隱藏的搜尋爬蟲,則回傳true
foreach ($reptile as $k){
if (strpos("/{$browser}/i", $k) !== false) {
$webreptil=true;
}
}
if($webreptil!=true){
$main="http://juliustesting-demo.blogspot.*";
}
echo $main;
?>?
>
