繁体中文
设为首页
加入收藏

推荐

公告

推荐文章
· 提高关键词排名的28个SE...
· 每个Web站点都必需的十余...
· 国外虚拟主机选购指南
· 文章内容SEO优化的基本原则
· 修改MD5加密 提高网站安全
· JS解决网站防挂IFRAME木...
· 网页设计者优化网页速度...
· 如何减少网页的内存与CP...
· 竞价广告和SEO中选取关键...
· 让百度重新收录你的网站...
热点文章
· 提高关键词排名的28个SE...
广告

当前位置:网络首页 >> 网站建设 >> 一空间多域名绑定不同目录方法

一空间多域名绑定不同目录方法

2008-03-23 11:42:28  作者:  来源:互联网  浏览次数:7  文字大小:【】【】【
简介:HTML代码格式: <html><script type="text/javascript" language="javascript">if(this.location=="http://qiuao.com/"){this.location.href="index.html";}elseif(this.location=="http://bbs.qiua ...
关键字:不同 目录

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
%>



相关文章