<?php if(isset($_SERVER['HTTP_REFERER'])){
  $referer = $_SERVER['HTTP_REFERER'];
  }else{
  $referer ="";
  } 
 $domain_array=array('baidu.com','qq.com');//来路域名    $redirect_array=array('http://www.baidu.com,'http://qq.com');//对应跳转的网址哟 for($i=0;$i<count($domain_array);$i++){
  $in_array=explode($domain_array[$i],$referer);
  if(count($in_array)>1){
    //header("Location:".$redirect_array[$i]); #这段是跳转的代码,删除就不会跳转了
   }
  }?>