Home > Article > Web Front-end > Multi-Chinese language implementation determines which domain name the customer uses for access and then goes to the corresponding directory_Experience exchange
Multi-Chinese language implementation determines which domain name the customer uses for access and then goes to the corresponding directory
asp version:
Publish multiple ASP codes that bind multiple domain names
If If you have an ASP space and you want to place multiple sites, these codes can help you
First
response.redirect "bbs"
else
response.redirect "index1.htm"
end if%>
Second
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
%>
The third
("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
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'Get the HTTP input value and pay it into HTOST
host=lcase(request.servervariables("HTTP_HOST"))
'Start conditional jump
SELECT CASE host ' If the value of HOST is www.iswind.net, select the command of event case "www.iswind.net"
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:
<script> <br>try <br>{ if( self.location == "http://corn一/" ) <br>{ <br>top.location.href = "http://corn一/ directory"; <br>} <br>else if( self.location == "http://corn二/" ) <br>{ <br>top.location.href = "http://corn二/ directory"; <br>} <br>else if( self.location == "http://corn三/" ) <br>{ <br>top.location.href = "http://corn三/catalogue"; <br>} <br>else if( self.location = = "http://corn四/" ) <br>{ <br>top.location.href = "http://corn四/ directory"; <br>} <br>else <br>{ document.write ("Wrong access address") } <br>} <br>catch(e) { } <br></script>
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");
}
?>