nickey
级别: 论坛版主
精华:
0
发帖: 32
威望: 0 点
金钱: 320 RMB
贡献值: 0 点
注册时间:2007-03-26
最后登录:2008-03-20
|
教你使用双线(多线)空间
智能解析篇
1,首先到www.dnspod.com注册,然后登陆。 2,添加新的域名: 填入你的域名 3,主机记录里填写www,线路类型选择电信,然后记录值填写你的电信服务器IP,增加 再在主机记录里填写www,线路类型选择网通,然后记录值填写你的网通服务器IP,增加 4,域名管理面板里修改DNS服务器为ns1.dnspod.net/ns2.dnspod.net或ns3.dnspod.net/ns4.dnspod.net 一般24小时后生效
智能跳转篇
1,将域名分别解析到各线路服务器的ip .如www解析至电信ip,cnc解析到网通ip 2,确定你的首页文档顺序 如果首页是index.php或者index.asp 那就将index.html做为默认文档 插入如下代码即可实现跳转
<script> i=1 var autourl=new Array() autourl[1]="[url]http://www.xxx.com/index.php"[/url] autourl[2]="[url]http://cnc.xxx.com/index.php"[/url] 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>
如果你的首页就是index.html 那就将文档顺序index.htm设为第一 index.htm做跳转页面
选择跳转篇
1,2步同上,只是代码如下,计算出响应时间,让访问者自己选择的,也可以与智能跳转篇结合应用
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns="[url]http://www.w3.org/1999/xhtml"[/url]><HEAD><TITLE>标题</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META http-equiv=Expires content=0> <META http-equiv=Cache-Control content=no-cache> <META http-equiv=Pragma content=no-cache> <STYLE type=text/css>BODY { BACKGROUND: #efefef; MARGIN: 0px; FONT: 9pt Tahoma; COLOR: #000; HEIGHT: auto; TEXT-ALIGN: center } #outbox { BORDER-RIGHT: #ccc 2px solid; BORDER-TOP: #ddd 1px solid; Z-INDEX: 888; BACKGROUND: #d4d0c8; LEFT: 50%; MARGIN: -130px 0px 0px -175px; BORDER-LEFT: #ddd 1px solid; WIDTH: 350px; BORDER-BOTTOM: #ccc 2px solid; POSITION: absolute; TOP: 50%; HEIGHT: auto } #title { BORDER-RIGHT: #999 1px solid; BORDER-TOP: #eee 1px solid; BORDER-LEFT: #eee 1px solid; BORDER-BOTTOM: #999 1px solid } #body { BORDER-RIGHT: #999 1px solid; BORDER-TOP: #eee 1px solid; BORDER-LEFT: #eee 1px solid; BORDER-BOTTOM: #999 1px solid } #bottom { BORDER-RIGHT: #999 1px solid; BORDER-TOP: #eee 1px solid; BORDER-LEFT: #eee 1px solid; BORDER-BOTTOM: #999 1px solid } #title { BACKGROUND: #c4c0c8; LINE-HEIGHT: 28px } #body { PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; HEIGHT: 140px; TEXT-ALIGN: center } #bottom { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; LINE-HEIGHT: 30px; PADDING-TOP: 2px; HEIGHT: 30px; TEXT-ALIGN: right } #input { BOTTOM: 0px; TOP: 0px } </STYLE>
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD> <BODY> <DIV id=outbox> <DIV id=title><STRONG>xxx - 线路选择</STRONG></DIV> <DIV id=body> <P>欢迎光临 “<SPAN id=sitename>“xxx”</SPAN>”,请选择适合您的线路:</P> <SCRIPT language=JavaScript type=text/javascript> <!-- var tim=1; setInterval("tim++",10); var b=1; var sitename = "xxx"; var pagepath = "/index.php"; document.getElementById("sitename").innerHTML = sitename; var autourl=new Array(); autourl[1]="bbs.opidc.cn"; autourl[2]="tel.bbs.opidc.cn"; autourl[3]="uni.bbs.opidc.cn"; autourl[4]="cnc.bbs.opidc.cn"; autourl[5]="hk.bbs.opidc.cn"; autourl[6]="usa.bbs.opidc.cn"; var autoname=new Array(); autoname[1]="移动主站"; autoname[2]="电信线路"; autoname[3]="联通线路"; autoname[4]="网通线路"; autoname[5]="香港线路"; autoname[6]="美国线路"; function butt(){ document.write("<form name=\"autof\">"); for(var i=1;i<autourl.length;i++){ document.write(autoname+":<input type=\"text\" name=\"txt"+i+"\" size=\"20\" value=\"测试中…\"> <input type=\"hidden\" name=\"url"+i+"\"><input type=\"button\" value=\"进入\" onclick=\"location=(this.form.url"+i+".value)\"><br />"); } document.write("</form>"); } butt(); function auto(url,b){ document.forms[0]["url"+b].value=url+pagepath; if(tim>3000){ document.forms[0]["txt"+b].value="链接超时" }else{ document.forms[0]["txt"+b].value="响应时间:"+tim/100+"秒" } } function run(){ for(var i=1;i<autourl.length;i++){ document.write("<img src=\"[url]http://"+autourl[/url]+"/"+Math.random()+"\" width=\"1\" height=\"1\" onerror=\"auto('http://"+autourl+"',"+i+")\" />"); } } if (window.external){ document.write("<p>"); for (var i=1;i<autourl.length;i++){ document.write(" <a href=\"JavaScript:void(0);\" style=\"text-decoration:none;\" onclick=\"window.external.AddFavorite('http://"+autourl+pagepath+"','"+sitename+"-"+autoname+"')\">"+autoname+"</a> "); } document.write("</p>"); } run(); //--> </SCRIPT> </DIV> <DIV id=bottom>©2006 笑嘻嘻([url]www.xxx.cn[/url]) All Rights Reserved.</DIV></DIV> <DIV style="BOTTOM: 0px; POSITION: absolute; TEXT-ALIGN: center"></DIV></BODY></HTML>
|
|
|
[楼 主]
|
Posted: 2007-03-26 09:44 |
| |