绑定多域名的ASP代码

来源:互联网 发布:手机淘宝怎么写评价 编辑:程序博客网 时间:2024/06/07 06:34
<%
'取得HTTP输入的值并付值到HTOST中
host=lcase(request.servervariables("HTTP_HOST"))
'开始条件跳转
Select CASE host
' 如果HOST的值是www.iswind.net就选择事件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

<script>try { if( self.location == "http://域名一/" ) {
top.location.href = "http://域名一/目录";
}
else if( self.location == "http://域名二/" ) {
top.location.href = "http://域名二/目录";
}
else if( self.location == "http://域名三/" ) {
top.location.href = "http://域名三/目录";
}
else if( self.location == "http://域名四/" ) {
top.location.href = "http://域名四/目录";
}
else { document.write ("错误的访问地址") } } catch(e) { }</script>
原创粉丝点击