第一步:创建转向控制页面
创建网站默认的首页文件(通常为"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空间,而得到各不相同的首页面了。