<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% Option Explicit %>
<%
'泛域名解析,By Tony
'on error resume next
dim i,QUERY_STRING,HostName
dim NewUrl:NewUrl = "
http://www."
dim HostStr:HostStr = "517usa.com,517us.com,517usa.com.cn,517us.net,517usa.net,starglory.com,starglory.com.cn,starglory.net,95dn.com,8yao.com"
Dim PageStr,PageArr,HostArr
PageStr = Request.ServerVariables("QUERY_STRING") '获得地址为 404;
http://*.517usa.com:80/ErrorStr
HostName = Request.ServerVariables("SERVER_NAME")
if Instr(PageStr,";") > 1 then
PageStr = Replace(Split(PageStr,";")(1),":80","") '去掉404和:80之后的干净地址
end if
PageArr = Split(PageStr,"/") 'PageArr(2)=ServerName
QUERY_STRING = ""
for i=3 to Ubound(PageArr)
QUERY_STRING = QUERY_STRING &"/"& PageArr(i)
Next
if HostName = "61.139.77.184" Then
Response.Redirect("
http://www.517usa.com"&QUERY_STRING)
Response.end
end if
HostArr = Split(HostStr,",")
for i=0 to Ubound(HostArr)
if Instr(LCase(HostName),HostArr(i)) > 1 then
if HostArr(i) = "8yao.com" and LCase(Split(HostName,".")(1))="blog" then
NewUrl = "
http://www.8yao.com/bbs/boke.asp?"&Split(HostName,".")(0)&".index.html"
else
if len(QUERY_STRING) < 1 then
NewUrl = NewUrl & HostArr(i)
else
NewUrl = NewUrl & HostArr(i) & QUERY_STRING
end if
end if
exit for
end if
Next
Response.Redirect(NewUrl)
Response.END
%>