多个绑定多域名的ASP代码
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
[p] 如果只有一个asp空间,而你又想放置多个多个站点,这些代码可以帮到你。[/p]
[p]第一个 [br]<%[br]if request.servervariables("server_name")="williamlong.info" then[br] response.redirect "williamlong/index.htm"[br]else[br] response.redirect "index2.htm"[br]end if[br]%>[/p] [p] [/p] [p]第二个[br]<%[br]select case request.servervariables("http_host")[br]case "williamlong.info" '1[br] server.transfer("v3.htm")[br]case "williamlong.info" '1[br] server.transfer("v3.htm")[br]case "moon-soft.com" '2[br] server.transfer("i.htm")[br]case "moon-blog.com" '3[br] server.transfer("moon-blog.htm")[br]...... 继续添加 ......[br]end select[br]%>[/p] [p]第三个[br]<%[br]if instr(request.servervariables("server_name"),"williamlong.info")>0 then[br] response.redirect "index.asp"[br]elseif instr(request.servervariables("server_name"),"moon-soft.com")>0 then[br] response.redirect "x/index.asp"[br]elseif instr(request.servervariables("server_name"),"moon-blog.com")>0 then[br] response.redirect "index3.asp"[br]end if[br]%>[/p] [p]第四个[br]<%[br]if request.servervariables("server_name")="williamlong.info" then[br] response.redirect "index1.asp"[br]elseif request.servervariables("server_name")="moon-soft.com" then[br] response.redirect "index2.asp"[br]elseif request.servervariables("server_name")="moon-blog.com" then[br] response.redirect "index3.asp"[br]end if[br]%>[/p] [p]第五个[br]<%[br]if request.servervariables("server_name")="williamlong.info" then[br] server.transfer("williamlong.htm")[br]elseif request.servervariables("server_name")="moon-soft.com" then[br] server.transfer("moon.htm")[br]elseif request.servervariables("server_name")="moon-blog.com" then[br] server.transfer("moon-blog.htm")[br]else[br] server.transfer("other.htm")[br]end if[br]%>[/p] 该文章在 2010/7/23 0:11:44 编辑过 |
关键字查询
相关文章
正在查询... |