Home >php教程 >php手册 >绑定多域名的PHP代码

绑定多域名的PHP代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-21 09:05:221161browse

这是一段很有用的代码,和绑定多域名的ASP代码类似,如果你只有一个PHP空间,而你又想放置多个多个站点,下面这些代码可以帮到你。代码很简单,与绑定多域名的ASP代码相似,就不多介绍了。

第一个:

if($HTTP_HOST=="www.moon-soft.com"){
Header("Location: moon.htm");
}
elseif($HTTP_HOST=="www.williamlong.info"){
Header("Location: williamlong.htm");
}
else{
Header("Location: other.htm");
}

第二个:

if($HTTP_HOST=="www.moon-soft.com"){
require "moon.htm";
}
elseif($HTTP_HOST=="www.williamlong.info"){
require "williamlong.htm";
}
else{
require "other.htm";
}



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn