专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Asp教程 » iis绑定多个域名:ASP实现多个域名绑定一个空间互不影响 »正文

iis绑定多个域名:ASP实现多个域名绑定一个空间互不影响

来源: 发布时间:星期四, 2009年2月12日 浏览:215次 评论:0


步:创建转向控制页面
  创建网站WebSite默认首页文件(通常为"index.asp"或"default.asp")如下:
引用 
<%
’取得HTTP输入值并付值到HTOST中
host=l(request.servervariables("HTTP_HOST"))
’开始条件跳转
SELECT CASE host
’ 如果HOST值是www.abc0.com就选择事件"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
%>
  第 2步:创建相应被转向文件
  创建"index_abc0.asp"—"index_abcN.asp"作为各个网站WebSite首页

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

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

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

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: