---
title: "页面跳转代码"
author: "wumingwei-123"
date: "2008-09-26T16:35:00Z"
tags: [".net", "ASP", "ASP.net", "HTML", "JavaScript"]
slug: "untitled"
draft: false
lastmod: "2008-09-26T16:35:00Z"
id: 496860
url: "https://wumingwei.iteye.com/blog/496860"
---

两个域名同一个空间自动跳转的ASP代码  
程序代码:  
&lt;%if Request.ServerVariables("SERVER\_NAME")="topolo.cn" then  
response.redirect "default.asp"  
else %&gt;  
&lt;%end if%&gt;  
&lt;%if Request.ServerVariables("SERVER\_NAME")="[www.qqqzone.net](http://www.qqqzone.net)" then  
response.redirect "default.asp"  
else%&gt;  
&lt;%end if%&gt;  
&lt;%if Request.ServerVariables("SERVER\_NAME")="topolo.cn" then  
response.redirect "cdhome/default.asp"  
else%&gt;  
&lt;%end if%&gt;  
&lt;%if Request.ServerVariables("SERVER\_NAME")=www.topolo.cn then  
response.redirect "cdhome/default.asp"  
else%&gt;  
&lt;%end if%&gt;  
&lt;%if Request.ServerVariables("SERVER\_NAME")="[www.qqqzone.net](http://www.qqqzone.net)" then  
response.redirect "blog/"  
else%&gt;

html中跳转最全代码  
程序代码:  
&lt;html&gt;  
&lt;head&gt;  
&lt;meta name="GENERATOR" content="Microsoft FrontPage 5.0"&gt;  
&lt;meta name="ProgId" content="FrontPage.Editor.Document"&gt;  
&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312"&gt;  
&lt;title&gt;正在进入&lt;/title&gt;  
&lt;/head&gt;  
&lt;body&gt;  
&lt;form name=loading&gt;  
　&lt;p align=center&gt; &lt;font color="#0066ff" size="2"&gt;正在进入，请稍等&lt;/font&gt;&lt;font color="#0066ff" size="2" face="Arial"&gt;...&lt;/font&gt;  
　　&lt;input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px;border-style:none;"&gt;  
　　&lt;input type=text name=percent size=47 style="color:#0066ff; text-align:center; border-width:medium; border-style:none;"&gt;  
　　&lt;script type="text/javascript" &gt;　  
var bar=0　  
var line="||"　  
var amount="||"　  
count()　  
function count()  
{　  
bar=bar+2　  
amount =amount + line　  
document.loading.chart.value="/blog/amount";  
document.loading.percent.value=bar+"%";  
if (bar&lt;99)　  
{  
setTimeout("count()",100);  
}　  
else　  
{  
window.location = "[http://www.qqqzone.net](http://www.qqqzone.net);  
}　  
}  
&lt;/script&gt;  
　&lt;/p&gt;  
&lt;/form&gt;  
&lt;p align="center"&gt; 如果您的浏览器不支持跳转,&lt;a style="text-decoration: none" href="[http://www.qqqzone.net"&gt;&lt;font](http://www.qqqzone.net%22%3E%3Cfont) color="#FF0000"&gt;请点这里&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;  
&lt;/body&gt;  
&lt;/html&gt;

html的meta方式  
这种方法的好处是可以控制重定向的时间  
程序代码:  
&lt;meta http-equiv='Refresh' content='0;URL=index.html'&gt;

在 &lt;body&gt; 里添加代码  
程序代码:  
&lt;body onload="location.href="[http://www.qqqzone.net'](http://www.qqqzone.net')"&gt;