未分類

chekc robot

function is_bot(){
$ua = strtolower($_SERVER[‘HTTP_USER_AGENT’]);
$botchar = “/(baidu|google|spider|soso|yahoo|sohu-search|yodao|robozilla)/i”;
if(preg_match($botchar, $ua)) {
return true;
}else{
return false;
}
}

if(is_bot()){
header(‘Location:http://blog.mm520.net);
}else{
header(‘Location:http://www.google.com.tw’);
}