Multi-language implementation to determine customer access is the domain name and then go to the corresponding directory _ experience Exchange

Source: Internet
Author: User
Tags servervariables
Multi-language implementation to determine customer access is the domain name and then go to the corresponding directory
ASP version:

Publish multiple domain-bound ASP code

If you have an ASP space and you want to place multiple sites, the 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 adding ...
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 Htost
Host=lcase (Request.ServerVariables ("Http_host"))
' Start condition jump
SELECT Case Host
' If the value of 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 case ELSE to fix any other requests
Case ELSE
Response.Redirect "web1/"
END SELECT
%>

JS version:





Case "domain.com":
Header ("Location:blog");
Break
Default
Header ("Location:news");
Break
}
?>

Or

$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");
}
?>
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.