Sep 18

不需要域名解析的无限量二级域名开设

学习
//本文件名必须是httpd配置文件所引导的第一个文件名,优先级必须高于index.php
function transfer() {
//转到你网站首页的代码
}
$domain=strtolower(trim(ltrim(strip_tags($_SERVER["HTTP_HOST"]))));
$check_from=strpos($_SERVER["HTTP_HOST"],"你的域名");
$subdomain=explode(".",$domain);
$subdomain=$subdomain[0];
if ($subdomain=="www" || $domain=="你的其他不想转向的域名") {
transfer();
}
else {
if (!empty($check_from)) {
echo "欢迎来到xxxx网会员".$subdomain."的商铺";
}
else {
transfer();
}
}
?>



因为index.html的优先级一般高于index.php,而上面的代码完全可以用js来实现,因此...
tags:

to "不需要域名解析的无限量二级域名开设"

Leave a Reply