多域名访问同一空间不同首页文件的php代码

可以实现不同域名访问同一空间访问不同的首页文件,从而可以区分。

<?
$domain=$HTTP_SERVER_VARS['HTTP_HOST'];
$domain=str_replace("www.","",$domain);

switch($domain)
{
case "429006.com" : include "index_3800.php"; break;
case "popx.us" : include "index_75678.php"; break;
case "wipeedu.cn" : include "index_wipe.php"; break;
case "g.cn" : include "index_google.php"; break;

default: include "index.php";break;
}
?>

Related Posts