发表多个绑定多域名的ASP代码
作者:cmscn 日期:2007-02-25
PHP
<?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");
}
?>
ASP
<%
'取得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>
评论: 8 | 引用: 0 | 查看次数: 986
发表评论