发表多个绑定多域名的ASP代码

如果有有一个ASP空间,而你又想放置多个多个站点,这些代码可以帮到你
第一个

1if Request.ServerVariables("SERVER_NAME")="www.yyjs.com" then   
2response.redirect "zkj"   
3else   
4response.redirect "i.htm"   
5end if

第二个

 1   
 2select case request.servervariables("http_host")   
 3case "www.yyjs.com" '1   
 4Server.Transfer("v3.htm")   
 5case "www.aspcn.net" '2   
 6Server.Transfer("i.htm")   
 7case "www.yyjs.cn" '3   
 8Server.Transfer("yyjs.htm")   
 9...... 继续添加 ......   
10end select   

第三个

 1if instr(Request.ServerVariables   
 2("SERVER_NAME"),"kekexi.com")>0 then   
 3response.redirect "index.asp"   
 4else if instr(Request.ServerVariables   
 5("SERVER_NAME"),"4668.com")>0 then   
 6response.redirect "x/index.asp"   
 7else if instr(Request.ServerVariables   
 8("SERVER_NAME"),"web315.com")>0 thenr   
 9esponse.redirect "index3.asp"   
10end if   
11end if   
12end if

第四个

1if Request.ServerVariables("SERVER_NAME")="www.yyjs.com" then   
2response.redirect "index1.asp"   
3else if Request.ServerVariables("SERVER_NAME")="www.ce.org.cn" then   
4response.redirect "index2.asp"   
5else if Request.ServerVariables("SERVER_NAME")="www.163.com" then   
6response.redirect "index3.asp"   
7end if   
8end if   
9end if
Published At
Categories with Web编程
Tagged with
comments powered by Disqus