多个域名绑定一个空间互不影响 ,请看以下ASP例程!
a4L0Itrp ^#A[cY2eM +)gXU Vwd 第一步:创建转向控制页面
M?fRiOj 创建网站默认的首页文件(通常为"index.asp"或"default.asp")如下:
p>@S61
&
[ QP?Deltp "Nn+Zw43 <%
qm&Z_6Pw '取得HTTP输入的值并付值到HTOST中
>`@yh-'r host=lcase(request.servervariables("HTTP_HOST"))
GqrOj++> '开始条件跳转
BOQeP/> SELECT CASE host
U8b1
sz ' 如果HOST的值是
www.abc0.com就选择事件case"
www.abc0.com"的命令
F}lgy;=h CASE "
www.abc0.com"
XFg.Z+ # ' Below is the redirect command
+H K)A%QI response.redirect "index_abc0.asp"
B!(t<W8cu CASE "
www.abc1.com"
/Lc=
K< ' Below is the redirect command
$VrKoL\ScA response.redirect "index_abc1.asp"
|@-%x.y CASE "
www.abc2.com"
a#0G
mK ' Below is the redirect command
FBGHVV
w! response.redirect "index_abc2.asp"
@x@
w<e% ' 继续添加...
#&1Y!kbdd CASE "
www.abcn.com"
Z w5\{Z0 ' Below is the redirect command
8i;N|:WdH response.redirect "index_abcn.asp"
16\U'< wYf=(w\c 'We use CASE ELSE to fix any other requests
7[-jr;v CASE ELSE
2`* %NJ response.redirect "default.asp"
&bJ98Nxl END SELECT
LIH>IpamN %>
e![Q1!r 9ok|]d P F$ .j|C1a 第二步:创建相应的被转向文件
GtO5,d_ 创建"index_abc0.asp"—"index_abcN.asp",作为各个网站的首页。
1A-8,) +&\TdvNI4 第三步:将多个域名的IP地址解析到同一个网站空间
DuvP3(K 例如:将"
www.abc1.com"—"
www.abcN.com"的IP地址全部解析到"
www.abc1.com"的WEB空间上。
_3p:q. UKK}$B 第四步:设置网站的WEB服务
e(
^9fg_SG 设置WEB服务的别名为:"
www.abc1.com www.abc2.com www.abc3.com ......
www.abcN.com"(注意:别名之前用一个空格分开)
TiBE9 ga^<_;5< 现在你就可以使用象"
http://www.abc1.com" 、……、"
http://www.abcN.com" 这类顶级的网址来访问同一个WEB空间,而得到各不相同的首页面了。
\wRr6-!_ CJKH"'u3^