多个绑定多域名的ASP代码
|
admin
2010年7月23日 0:11
本文热度 4214
|
如果只有一个asp空间,而你又想放置多个多个站点,这些代码可以帮到你。
第一个
<%
if request.servervariables("server_name")="williamlong.info" then
response.redirect "williamlong/index.htm"
else
response.redirect "index2.htm"
end if
%>
第二个
<%
select case request.servervariables("http_host")
case "williamlong.info" '1
server.transfer("v3.htm")
case "williamlong.info" '1
server.transfer("v3.htm")
case "moon-soft.com" '2
server.transfer("i.htm")
case "moon-blog.com" '3
server.transfer("moon-blog.htm")
...... 继续添加 ......
end select
%>
第三个
<%
if instr(request.servervariables("server_name"),"williamlong.info")>0 then
response.redirect "index.asp"
elseif instr(request.servervariables("server_name"),"moon-soft.com")>0 then
response.redirect "x/index.asp"
elseif instr(request.servervariables("server_name"),"moon-blog.com")>0 then
response.redirect "index3.asp"
end if
%>
第四个
<%
if request.servervariables("server_name")="williamlong.info" then
response.redirect "index1.asp"
elseif request.servervariables("server_name")="moon-soft.com" then
response.redirect "index2.asp"
elseif request.servervariables("server_name")="moon-blog.com" then
response.redirect "index3.asp"
end if
%>
第五个
<%
if request.servervariables("server_name")="williamlong.info" then
server.transfer("williamlong.htm")
elseif request.servervariables("server_name")="moon-soft.com" then
server.transfer("moon.htm")
elseif request.servervariables("server_name")="moon-blog.com" then
server.transfer("moon-blog.htm")
else
server.transfer("other.htm")
end if
%>
该文章在 2010/7/23 0:11:44 编辑过