Multi-medium language implementation to determine the client access using the domain name and then go to the corresponding directory
ASP version:
Publishing ASP code with multiple bound multiple domains
If you have an ASP space and you want to place multiple sites, this code can help you
First one
<%if request.servervariables ("server_name") = "bbs.along.com.ru" Then
Response.Redirect "BBS"
Else
Response.Redirect "Index1.htm"
End If%>
A second
<%
Select Case Request.ServerVariables ("Http_host")
Case "www.along.com.ru" ' 1
Server.Transfer ("along.htm")
Case "www.along.net.ru" ' 2
Server.Transfer ("net.htm")
Case "www.null.com.ru" ' 3
Server.Transfer ("null.htm")
...... Continue to add ...
End Select
%>
A third
<%if InStr (Request.ServerVariables
("SERVER_NAME"), "Fjsky.info") >0 Then
Response.Redirect "Index.asp"
else If InStr (Request.ServerVariables
("SERVER_NAME"), "along.com.ru") >0 Then
Response.Redirect "X/index.asp"
else If InStr (Request.ServerVariables
("SERVER_NAME"), "along.net.ru") >0 Thenr
Esponse.redirect "Index3.asp"
End If
End If
End If%>
Fourth one
<%if request.servervariables ("server_name") = "Www.fjsky.info" Then
Response.Redirect "Main1.asp"
else if Request.ServerVariables ("server_name") = "Fjsky.info" Then
Response.Redirect "Main1.asp"
else if Request.ServerVariables ("server_name") = "www.null2.com.ru" Then
Response.Redirect "/web/index.asp"
else if Request.ServerVariables ("server_name") = "null2.com.ru" Then
Response.Redirect "/web/index.asp"
End If
End If
End If
End If%>
Fifth one
<%
' Get the value of the HTTP input and pay the value to the Htost
Host=lcase (Request.ServerVariables ("Http_host"))
' Start condition jump
SELECT Case Host
' If the value of the host is www.iswind.net, select the event case ' www.iswind.net ' command
Case "Www.abc.net"
' Below is the redirect command
Response.Redirect "web/"
Case "Www.efd.com"
Response.Redirect "web1/"
' We Use the case ELSE to the fix any other requests
Case ELSE
Response.Redirect "web1/"
End SELECT
%>
JS version:
<script>
Try
{if (self.location = "http://corn One/")
{
Top.location.href = "http://Corn one/catalogue";
}
else if (self.location = "http://corn Two/")
{
Top.location.href = "http://corn two/catalogue";
}
else if (self.location = "http://corn Three/")
{
Top.location.href = "http://corn three/catalogue";
}
else if (self.location = "http://corn Four/")
{
Top.location.href = "http://corn four/catalogue";
}
Else
{document.write ("Bad Access Address")}
}
catch (e) {}
</script>
Case "domain.com":
Header ("Location:blog");
Break
Default
Header ("Location:news");
Break
}
?>
Or
<?php
$domain _net= "yeahe.com";
$dot _net_url= "bbs/";
$dot _com_url= "Flash";
if ($HTTP _host== "$domain _net") or ($HTTP _host== "www. $domain _net"))
{
Header ("Location: $dot _net_url");
}
Else
{
Header ("Location: $dot _com_url");
}
?>