$domain = $HTTP_HOST;
$domain = strtolower($domain);
$from = (substr($domain,0,4)=="xn--") ? 4 : 0;
$dir = substr($domain,$from,2);
if(!is_file("/alldocs/urlcert/$dir/$domain")) {
if(is_file("/alldocs/urlblack/$dir/$domain")) {
// Header("Location: /notice.html");
header("HTTP/1.0 404 Not Found");
include("/alldocs/htdocs/url/include/class.FastTemplate.php");
$tpl = new FastTemplate("/var/www/html/");
$tpl->define(array(index => "notice.html"));
$tpl->parse(MAIN,array("index"));
$tpl->FastPrint();
exit;
}
}
if(!$from)
$from = (substr($domain,0,8)=="www.xn--") ? 8 : 0; #modify by zsy 2008.5.28
if(!$from)
$from = (substr($domain,0,4)=="www.") ? 4 : 0; #modify by zsy 2008.5.28
$dir = substr($domain,$from,2);
$file = "/alldocs/urldata/$dir/$domain";
//echo "\$file=$file
";
if(is_file($file)) {
$fp = fopen($file,"r");
$contents = fread($fp,filesize($file));
fclose($fp);
//echo "$contents
";
$f = explode("|",$contents);
$url = $f[1];
$pri = $f[2];
$name = $f[3];
} else {
$url = "";
$pri = 3;
$name = $domain;
}
$adstr = ($pri & 0) ? "" : "";
if($url!="") {
if($pri==1 || $pri==3 && !$adstr) {
Header("Location: $url");
} else {
?>