教學寫在 DEMO 這邊
是因為這邊比較容易理解這東西的優點
在我的個人網誌中所使用的標籤太過抽像不夠直覺化
簡單的來說就是個人風格太重
看不出這東西的優點
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;
?>?
>
