这是一段很有用的代码,和绑定多域名的ASP代码类似,如果你只有一个PHP空间,而你又想放置多个多个站点,下面这些代码可以帮到你。
第一个:
if($HTTP_HOST=="www.xxx.com"){
Header("Location: xxx.htm");
}
elseif($HTTP_HOST=="www.xxx1.info"){
Header("Location: xxx1.htm");
}
else{
Header("Location: other.htm");
}
第二个:
if($HTTP_HOST=="www.xxx.com"){
require "xxx.htm";
}
elseif($HTTP_HOST=="www.xxx1.info"){
require "xxx1.htm";
}
else{
require "other.htm";
}