通过一个默认首页进行对来访用户的判断 然后转向不同的地址 达到一个相对理想的速度
下面段代码 把他保存成xxx.htm 然后放到你目录内 在默认首页里边 设置他为第一个访问
那么访问的时候就会先访问这个文件 然后产生一个判断 电信的用户指向到指定的电信站点 网通用户指向到网通域名
使用的方法是 解析一个域名 如 xxx.abc.com 到电信 IP 然后解析一个 cnc.abc.com到网通IP 把这两个域名绑定到一个IIS上 这个时候 两个域名访问的都是同样的网站 但是确不是同一线路 ^_^ 用下面的代码就可以实现对用户的一个跳转 呵呵 感谢一个用户的提供
<html>
<head>
<Script Langage=Javascript>
i=1
var autourl=new Array()
autourl[1]="http://cnc.abc.com/default.asp" //修改为网通访问地址
autourl[2]="http://www.abc.com/default.asp" //修改为电信访问地址
function auto(url)
{
if(i)
{
i=0;
top.location=url
}}
function run()
{
for(var i=1;
i<autourl.length;i++)
document.write("<img src="+autourl[i]+" width=1 height=1 onerror=auto('"+autourl[i]+"')>")
}
run()
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</body>
<style type="text/css">
<!--
.STYLE1 {
color: #FF0000;
font-size: 14px;
font-weight: bold;
}
-->
</style>
<table width="500" border="0" align="center">
<tr>
<td><p align="center" class="STYLE1">本网站采用双线路系统,正在为您选择最快服务器路线,请稍等...
</td>
</tr>
</table>
</html>
下面段代码 把他保存成xxx.htm 然后放到你目录内 在默认首页里边 设置他为第一个访问
那么访问的时候就会先访问这个文件 然后产生一个判断 电信的用户指向到指定的电信站点 网通用户指向到网通域名
使用的方法是 解析一个域名 如 xxx.abc.com 到电信 IP 然后解析一个 cnc.abc.com到网通IP 把这两个域名绑定到一个IIS上 这个时候 两个域名访问的都是同样的网站 但是确不是同一线路 ^_^ 用下面的代码就可以实现对用户的一个跳转 呵呵 感谢一个用户的提供
<html>
<head>
<Script Langage=Javascript>
i=1
var autourl=new Array()
autourl[1]="http://cnc.abc.com/default.asp" //修改为网通访问地址
autourl[2]="http://www.abc.com/default.asp" //修改为电信访问地址
function auto(url)
{
if(i)
{
i=0;
top.location=url
}}
function run()
{
for(var i=1;
i<autourl.length;i++)
document.write("<img src="+autourl[i]+" width=1 height=1 onerror=auto('"+autourl[i]+"')>")
}
run()
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</body>
<style type="text/css">
<!--
.STYLE1 {
color: #FF0000;
font-size: 14px;
font-weight: bold;
}
-->
</style>
<table width="500" border="0" align="center">
<tr>
<td><p align="center" class="STYLE1">本网站采用双线路系统,正在为您选择最快服务器路线,请稍等...
</td>
</tr>
</table>
</html>
