多个域名绑定一个空间互不影响 ,请看以下ASP例程!
!zK"y[V rCo}^M4Pb 7{r7 第一步:创建转向控制页面
Ku'a,\7z 创建网站默认的首页文件(通常为"index.asp"或"default.asp")如下:
t ]BG)] 4zs0+d+ Bl>m`/\
1i <%
R*6TS"aL '取得HTTP输入的值并付值到HTOST中
f#c}}>V8 host=lcase(request.servervariables("HTTP_HOST"))
s(X\7Hz_nC '开始条件跳转
Ktk?(49 SELECT CASE host
$}4ao2 ' 如果HOST的值是
www.abc0.com就选择事件case"
www.abc0.com"的命令
@0@WklA
JA CASE "
www.abc0.com"
H7uh"/A ' Below is the redirect command
~vYFQKrb response.redirect "index_abc0.asp"
Ifp8oL? S; CASE "
www.abc1.com"
UK
6x]tE ' Below is the redirect command
y_:{p5u response.redirect "index_abc1.asp"
|g hyH CASE "
www.abc2.com"
?jmL4V2-f ' Below is the redirect command
GYtgw9 "Y response.redirect "index_abc2.asp"
odL*_<Z ' 继续添加...
e=##X}4zZ CASE "
www.abcn.com"
iklZ[G%A0 ' Below is the redirect command
k/F#-},Q. response.redirect "index_abcn.asp"
Q)E3)), fbM>jK 'We use CASE ELSE to fix any other requests
zZd.
U\"2 CASE ELSE
e6*,MnqBh response.redirect "default.asp"
WXo b
h END SELECT
7Tp+]"bL %>
n"?*"Ya uju'Bs7 ]fDb|s48 第二步:创建相应的被转向文件
zv"NbN 创建"index_abc0.asp"—"index_abcN.asp",作为各个网站的首页。
;P<h9( K:13t
| 第三步:将多个域名的IP地址解析到同一个网站空间
vMY!Z1.* 例如:将"
www.abc1.com"—"
www.abcN.com"的IP地址全部解析到"
www.abc1.com"的WEB空间上。
2asRJ97qES ,n%b~.$:v5 第四步:设置网站的WEB服务
Mp
js 设置WEB服务的别名为:"
www.abc1.com www.abc2.com www.abc3.com ......
www.abcN.com"(注意:别名之前用一个空格分开)
W$7H "tg K20Hh7cVJ 现在你就可以使用象"
http://www.abc1.com" 、……、"
http://www.abcN.com" 这类顶级的网址来访问同一个WEB空间,而得到各不相同的首页面了。
-~RGjx 8_wh9