Home > php教程 > php手册 > body text

绑定多域名的PHP代码

WBOY
Release: 2016-06-21 09:05:22
Original
1116 people have browsed it

这是一段很有用的代码,和绑定多域名的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";
}



Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template