当前位置: 首页 > 图文教程 > 网络编程 > ASP > 多个绑定多域名的ASP代码

ASP
isNull(str), isEmpty(str)和 str = 的区别
使用ADO批量更新记录(源代码)
自己动手,结合javascript和dhtml做一个ubb编辑器
检查Email地址的比较完善的正则表达式函数
从Access数据库恢复BMP图像并显示在WEB页面(microsoft)
ASP环境下邮件列表功能的实现 (四)(推荐)
在ASP应用中如何限制同一表单被多次提交!!!!好东西
了解MSMQ,控制ASP进程 (一)
了解MSMQ,控制ASP进程 (二)
ASP技术在论坛中的运用(一)(吐血推荐!!!!)
ASP技术在论坛中的运用(二)(吐血推荐!!!!)
ASP技术在论坛中的运用(三)(吐血推荐!!!!)
ASP技术在论坛中的运用(四)(吐血推荐!!!!)
ASP技术在论坛中的运用(五)(吐血推荐!!!!)
ASP技术在论坛中的运用(六)(吐血推荐!!!!)
ASP技术在论坛中的运用(七)(吐血推荐!!!!)
ASP技术在论坛中的运用(八)(吐血推荐!!!!)
不用数据源打开数据库(DSNless connection)
大部分的ADO的错误码对应的含义
好东西,翻页程序,大家可以参考

多个绑定多域名的ASP代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 92 ::
收藏到网摘: n/a

第一种方法:

如果有有一个ASP空间,而你又想放置多个多个站点,这些代码可以帮到你:

以下为引用的内容:
第一个
<%if Request.ServerVariables("SERVER_NAME")="www.netbei.com" then
response.redirect "zkj"
else
response.redirect "i.htm"
end if%>

第二个
<%
select case request.servervariables("http_host")
case "www.netbei.com" '1
Server.Transfer("v3.htm")
case "www.aspcn.net" '2
Server.Transfer("i.htm")
case "www.netbei.cn" '3
Server.Transfer("netbei.htm")
...... 继续添加 ......
end select
%>

第三个
<%if instr(Request.ServerVariables
("SERVER_NAME"),"kekexi.com")>0 then
response.redirect "index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"4668.com")>0 then
response.redirect "x/index.asp"
else if instr(Request.ServerVariables
("SERVER_NAME"),"web315.com")>0 thenr
esponse.redirect "index3.asp"
end if
end if
end if%>

第四个
<%if Request.ServerVariables("SERVER_NAME")="www.netbei.com" then
response.redirect "index1.asp"
else if Request.ServerVariables("SERVER_NAME")="www.ce.org.cn" then
response.redirect "index2.asp"
else if Request.ServerVariables("SERVER_NAME")="www.163.com" then
response.redirect "index3.asp"
end if
end if
end if%>

以下为引用的内容:

第二种方法:


<%
dim domainname,result
domainname=Request.ServerVariables("SERVER_NAME")
result=right(domainname,12)
if result="my.netbei.com" then
%>
<!--#include file=mynetbei.asp -->
<%
Elseif result="rtisancn.com" then
%>
<!--#include file=artisan.asp -->
<%
Elseif result="gn.netbei.com" then
%>
<!--#include file=web.asp -->
<%
Elseif result=".forwest.com" then
%>
<!--#include file=forwest_com.asp -->
<%
Else
%>
<!--#include file=netbei.asp -->
<%
End if
%>