HTML代码格式:
<html>
<script type="text/javascript" language="javascript">
if(this.location=="http://qiuao.com/")
{this.location.href="index.html";}
else
if(this.location=="http://bbs.qiuao.com/")
{this.location.href="blog";}
else
{this.location.href="index.html";}
</script>
</html>
ASP代码格式一:
<%
host=lcase(request.servervariables("HTTP_HOST"))
SELECT CASE host
CASE "xishui.info"
response.redirect "blog/"
CASE "www.qiuao.com"
response.redirect "asp.asp"
CASE ELSE
response.redirect "index.htm"
END SELECT
%>
ASP代码格式二:
<%
Dim StrDomain
StrDomain=Request.ServerVariables("SERVER_NAME")
'获得包含域名的字符串
select case StrDomain
case "www.aaa.com"
Response.redirect "http://www.aaa.com/aaa/index.asp"
case "www.bbb.com"
Response.redirect "http://www.bbb.com/bbb/index.asp"
case else
Response.write "未知错误"
end select
%>
ASP代码格式三:
把所有域名都指向根目录 然后在index.asp使用跳转
<%
host=lcase(request.servervariables("HTTP_HOST"))
SELECT CASE host
CASE "www.qiuao.com"
response.redirect "01/"
CASE "bbs.qiuao.com"
response.redirect "02/"
CASE ELSE
response.redirect "03/"
END SELECT
%>
ASP代码格式四:
<%
if instr(Request.ServerVariables("SERVER_NAME"),"dewish.net") then
response.redirect "/2006/index.asp"
else if instr(Request.ServerVariables("SERVER_NAME"),"www.qiuao.com") then
response.redirect "/2006/index.asp"
else if instr(Request.ServerVariables("SERVER_NAME"),"qiuao.com") then
response.redirect "/2006/article/index.asp"
else if instr(Request.ServerVariables("SERVER_NAME"),"www.to55.com") then
response.redirect "/2006/article/index.asp"
end if
end if
end if
end if
%>

