ASP空间设置不同域名到不同目录的方法

第一个
<%if Request.ServerVariables("SERVER_NAME")="www.jsust.com" then
response.redirect "zkj"
else
response.redirect "i.htm"
end if%>

第二个
<%
select case request.servervariables("http_host")
case "www.jsust.com" '1
Server.Transfer("v3.htm")
case "www.poo.cn" '2
Server.Transfer("i.htm")
case "www.qqsky.cn" '3
Server.Transfer("yyjs.htm")
...... 继续添加 ......
end select
%>

第三个
<%if instr(Request.ServerVariables
("SERVER_NAME"),"jsust.com")>0 then
response.redirect "index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"52188.com")>0 then
response.redirect "x/index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"qqsky.cn")>0 thenr
esponse.redirect "index3.asp"
end if
end if
end if%>

第四个
<%if Request.ServerVariables("SERVER_NAME")="www.jsust.com" then
response.redirect "index1.asp"
else if Request.ServerVariables("SERVER_NAME")="www.poo.cn" then
response.redirect "index2.asp"
else if Request.ServerVariables("SERVER_NAME")="www.qqsky.cn" then
response.redirect "index3.asp"
end if
end if
end if%>

还有些自己要研究下
在虚拟主机的空间越来越大了,一般的情况下,一个网站是用不完的(软件、电影下载类不在其列)。

  那么,怎样让已有的空间超值使用呢?请按以下步骤操作:

  第一步:创建转向控制页面
  创建网站默认的首页文件(通常为"index.asp"或"default.asp")如下:
<%
select case request.servervariables("http_host")
case "www.abc1.com" '域名1
Server.Transfer("index_abc1.asp")
case "www.abc2.com" '域名2
Server.Transfer("index_abc2.asp")
case "www.abc3.com" '域名3
Server.Transfer("index_abc3.asp")
'...... 继续添加 ......
case else '域名N
Server.Transfer("index_abcN.asp")
end select
%>
第二步:创建相应的被转向文件
  创建"index_abc0.asp"—"index_abcN.asp",作为各个网站的首页。

  第三步:将多个域名的IP地址解析到同一个网站空间
  例如:将"www.abc1.com"—"www.abcN.com"的IP地址全部解析到"www.abc1.com"的WEB空间上。

  第四步:设置网站的WEB服务
  设置WEB服务的别名为:"www.abc1.com www.abc2.com www.abc3.com ...... www.abcN.com"(注意:别名之前用一个空格分开)

  呵呵,现在你就可以使用象"http://www.abc1.com"、……、"http://www.abcN.com"这类顶级的网址来访问同一个WEB空间,而得到各不相同的首页面了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值