两个域名同一个空间自动跳转的ASP代码

ASP/Visual Basic代码
  1. <%if Request.ServerVariables("SERVER_NAME")="gangege.com" then   
  2. response.redirect "default.asp"  
  3. else%>   
  4. <%end if%>   
  5. <%if Request.ServerVariables("SERVER_NAME")=www.gangege.com then   
  6. response.redirect "default.asp"  
  7. else%>   
  8. <%end if%>   
  9. <%if Request.ServerVariables("SERVER_NAME")="im027.com" then   
  10. response.redirect "cdhome/default.asp"  
  11. else%>   
  12. <%end if%>   
  13. <%if Request.ServerVariables("SERVER_NAME")=www.im027.com then   
  14. response.redirect "cdhome/default.asp"  
  15. else%>   
  16. <%end if%>   
  17. <%if Request.ServerVariables("SERVER_NAME")="blog.im027.com" then   
  18. response.redirect "blog/"  
  19. else%>   
  20.   

 

html中跳转最全代码

XML/HTML代码
  1. <html>  
  2. <head>  
  3. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">  
  4. <meta name="ProgId" content="FrontPage.Editor.Document">  
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">  
  6. <title>正在进入</title>  
  7. </head>  
  8. <body>  
  9. <form name=loading>    
  10.  <p align=center> <font color="#0066ff" size="2">正在进入,请稍等</font><font color="#0066ff" size="2" face="Arial">...</font>  
  11.   <input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;">    
  12.      
  13.   <input type=text name=percent size=47 style="color:#0066ff; text-align:center; border-width:medium; border-style:none;">    
  14.   <script>     
  15. var bar=0     
  16. var line="||"     
  17. var amount="||"     
  18. count()     
  19. function count(){     
  20. barbar=bar+2     
  21. amountamount =amount + line     
  22. document.loading.chart.value=amount     
  23. document.loading.percent.value=bar+"%"     
  24. if (bar<99)     
  25. {setTimeout("count()",100);}     
  26. else     
  27. {window.location = "http://www.gangege.com";}     
  28. }</script>    
  29.  </p>    
  30. </form>    
  31. <p align="center"> 如果您的浏览器不支持跳转,<a style="text-decoration: none" href="http://gangege.com"><font color="#FF0000">请点这里</font></a>.</p>  
  32. </body>  
  33. </html>  
  34.   

 

html的meta方式
这种方法的好处是可以控制重定向的时间

XML/HTML代码
  1. <meta http-equiv='Refresh' content='0;URL=index.html'>  

 

在 <body> 里添加代码

XML/HTML代码
  1. <body onload="location.href='www.gangege.com'">