27
2007
08

让空间实现多个域名绑定子目录的办法

很多人可以由于自己有一个大空间用不完,而且想做几个站,但是无法绑定域名到子目录,所以很郁闷,而且主机服务商也不给你开通,开通子目录绑定是要花钱的!核桃经过几天的整理,介绍下面四个实现空间自由绑定子目录的办法,适用于支持ASP的空间!让你实现一个空间多个站点!

第一个

 程序代码
*************开始此行不用***********************
<%if Request.ServerVariables("SERVER_NAME")="www.abseo.cn" then
response.redirect "zkj"
else
response.redirect "i.htm"
end if%>
****************结束此行不用*********************

第二个

 程序代码
*************开始此行不用***********************
<%
select case request.servervariables("http_host")
case "www.abseo.cn" '1
Server.Transfer("v3.htm")
case "www.sina.cn" '2
Server.Transfer("i.htm")
case "www.163.com" '3
Server.Transfer("yyjs.htm")
...... 继续添加 ......
end select
%>
****************结束此行不用*********************


第三个

 程序代码
*************开始此行不用***********************
<%if instr(Request.ServerVariables
("SERVER_NAME"),"abseo.cn")>0 then
response.redirect "index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"163.com")>0 then
response.redirect "x/index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"sina.com")>0 thenr
esponse.redirect "index3.asp"
end if
end if
end if%>
****************结束此行不用*********************


第四个

 程序代码
*************开始此行不用***********************
<%if Request.ServerVariables("SERVER_NAME")="www.abseo.cn" then
response.redirect "index1.asp"
else if Request.ServerVariables("SERVER_NAME")="www.cg8.org.cn" then
response.redirect "index2.asp"
else if Request.ServerVariables("SERVER_NAME")="www.163.com" then
response.redirect "index3.asp"
end if
end if
end if%>
****************结束此行不用*********************

大家要自己测试了,核桃试过可以用的,不过可能你们自己直接用的时候会出问题,学会自己调试吧!



整理核桃
首发http://www.abseo.cn/
原文http://www.abseo.cn/blog/webmaster_collect/zmlbd.html
原创文章,版权所有。转载时必须以链接形式注明作者和及本声明。
« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。