PHP判断域名是否存在指定文件,不存在就301到其他

$domaintxt=file_get_contents(path ."/host/host.txt");
$yum=$_SERVER['HTTP_HOST'];
$ymz=explode('.', $yum);
if(!stristr($domaintxt,$ymz[count($ymz) - 2]) ){
//$domainsz=file(DIR ."/list/domains/domains.txt");
//$mb301=trim(varray_rand( $domainsz));
header('HTTP/1.1 301 Moved Permanently');
header("Location: http://www.shjlqq.com ");
exit;
}

posted @ 2017-07-26 17:43  在下刘彦直  阅读(373)  评论(0编辑  收藏  举报