多域名同一空间的处理实例附(ASP代码
http://www.iswind.net
http://www.gdvet.com
这两个域名都是绑在同一个空间上,哈,但会跳到不同的目录,不是在IIS设置上实现的,只是一小段ASP代码,哈,。。。给出代码大家看看,虽然不是什么高深的东西,但挺实用的。
Code: [Copy to clipboard]
<%
'取得HTTP输入的值并付值到HTOST中
host=lcase(request.servervariables("HTTP_HOST"))
‘开始条件跳转
SELECT CASE host
' 如果HOST的值是www.iswind.net就选择事件case"www.iswind.net"的命令
CASE "www.iswind.net"
' Below is the redirect command
response.redirect "bbs/"
CASE "www.gdvet.com"
response.redirect "inc/"
'We use CASE ELSE to fix any other requests
CASE ELSE
response.redirect "inc/"
END SELECT
%>
<%if Request.ServerVariables("SERVER_NAME")="cqforest.com" then
response.redirect "http://cqforest.com/default.asp"
else%>
<%end if%>
<%if Request.ServerVariables("SERVER_NAME")="www.cqforest.com" then
response.redirect "http://www.cqforest.com/default.asp"
else%>
<%end if%>
转别人的帖子。。。我说的是可行的哦。
[align=right][color=#000066][此贴子已经被作者于2004-2-26 18:25:48编辑过][/color][/align]