PHP根据referer跳转:
<?php
$ref = $_SERVER['HTTP_REFERER'];
if(stripos($ref,"baidu") || stripos($ref,"google")
{
header("Location: https://www.haiyun.me");
exit;
}
?>
JS判断方法:
<script>
var s=document.referrer;
if(s.indexOf("baidu")>0||s.indexOf("soso")>0||s.indexOf("google")>0||s.indexOf("yahoo")>0||s.indexOf("sogou")>0||s.indexOf("youdao")>0||s.indexOf("bing")>0)
{
self.location="https://www.haiyun.me";
}
</script>
根据UA跳转:
<?php
$userAgent = $_SERVER['HTTP_USER_AGENT'];
if(stripos($userAgent,"Moz") || stripos($userAgent,"baidu"))
{
header("Location: https://www.haiyun.me");
}
?>