如果只有一個(gè)asp空間,而你又想放置多個(gè)多個(gè)站點(diǎn),這些代碼可以幫到你。
第一個(gè)
<%
if request.servervariables("server_name")="williamlong.info" then
response.redirect "williamlong/index.htm"
else
response.redirect "index2.htm"
end if
%>
第二個(gè)
<%
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")
...... 繼續(xù)添加 ......
end select
%>
第三個(gè)
<%
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
%>
第四個(gè)
<%
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
%>
第五個(gè)
<%
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 編輯過(guò)