<?php //本代码添加到任意html上面即可,不影响正常html的使用。 //$referer = $_SERVER['HTTP_REFERER']; $to = $_GET['t']; //如果不是从a站lp页面来的并且t参数不等于1024,那么就不执行js跳转 //if ($to=='1024' and $referer == "https://baidu.com") { if ($to=='1024') { //当前lp所在页面地址 // $link = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];//如果是二级域名一定要填写,如果是根域名或www那就去掉test $link = 'https://' . $_SERVER['HTTP_HOST'];//如果是只要主页不要后面的.php或目录,可以去掉$_SERVER['PHP_SELF'] $togo = 'https://baidu.com';//offer链接地址 echo '<script> var hUrl = "'.$link.'"; if (hUrl!=""){ var htxt = "Wait a second ..."; history.replaceState(null, htxt, hUrl); history.pushState(null, htxt, hUrl); history.pushState(null, htxt, hUrl); history.pushState(null, htxt, hUrl); delete window.document.referrer; window.document.__defineGetter__("referrer", function () { return hUrl; }); window.location.replace("'.$togo.'"); location.href ="'.$togo.'"; } </script>'; } ?>