枫叶交流论坛



 
标题: 突破限制!一个空间可以绑定无数个域名!
admin





UID 1
精华 0
积分 4707
帖子 3656
阅读权限
注册 2006-12-23
状态 离线
发表于 2007-2-6 15:53  资料 短消息 
突破限制!一个空间可以绑定无数个域名!

<%
name=request.servervariables("HTTP_HOST")
if(name="x.com" or name="www.x.com") then
response.redirect ("http://www.x.com/index.asp")
elseif(name="x.cn" or name="www.x.cn") then
response.redirect ("http://www.x.cn/default1.htm")
elseif(name="x.com.cn" or name="www.x.com.cn") then
response.redirect ("http://www.x.com.cn/default.htm")
elseif(name="x.org" or name="www.x.org") then
response.redirect ("http://www.x.org/2005/")
end if
%>




第一步:创建转向控制页面
  创建网站默认的首页文件(通常为"index.ASP"或"default.ASP")如下:


<%
'取得HTTP输入的值并付值到HTOST中
host=lcase(request.servervariables("HTTP_HOST"))
'开始条件跳转
SELECT CASE host
' 如果HOST的值是www.abc0.com就选择事件case"www.abc0.com"的命令
CASE "www.abc0.com"
' Below is the redirect command
response.redirect "index_abc0.ASP"
CASE "www.abc1.com"
' Below is the redirect command
response.redirect "index_abc1.ASP"
CASE "www.abc2.com"
' Below is the redirect command
response.redirect "index_abc2.ASP"
' 继续添加...
CASE "www.abcn.com"
' Below is the redirect command
response.redirect "index_abcn.ASP"

'We use CASE ELSE to fix any other requests
CASE ELSE
response.redirect "default.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空间,而得到各不相同的首页面了。
顶部
[广告] 全新不用K线图的傻瓜股票分析软件财富股市侦探准确性高www.cf008.com
 


当前时区 GMT+8, 现在时间是 2009-1-8 07:24

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.058460 second(s), 6 queries

清除 Cookies - 联系我们 - 枫叶技术支持. - Archiver - WAP