一个网站挂多个域名,根据来访域名自动跳转到相应页面asp和php实现的程序
ASP 代码:
<%
Dim strDomain
strDomain = LCase(Request.ServerVariables("SERVER_NAME"))
Select Case strDomain
Case "afei.org.ua" : Response.Redirect "http://www.chengfei.net"
Case "www.afei.org.ua" : Response.Redirect "http://www.chengfei.net"
Case Else : Response.Redirect "http://www.chengfei.net"
End Select
%>
PHP代码:
if(($http_host=="mahoupao.net")or($http_host=="www.mahoupao.net"))
{
header("location: /1");
}
elseif(($http_host=="1111.com")or($http_host=="www.1111.com"))
{
header("location: /2");
}
else
{
header("location: /3");
}
?>
