多個綁定多域名的ASP代碼_ASP教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      推薦:ASP錯誤代碼說明
      錯誤代碼 錯誤消息 說明 ASP0100 Out of memory 內(nèi)存不足(不能分配要求的內(nèi)存 ASP0101 Unexpected error 意外錯誤 ASP0102 Expecting string input 缺少字符串輸入 ASP0103 Expe

      第一種方法:

      如果有有一個ASP空間,而你又想放置多個多個站點(diǎn),這些代碼可以幫到你:

      以下為引用的內(nèi)容:
      第一個
      <%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")
      ...... 繼續(xù)添加 ......
      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%>

      以下為引用的內(nèi)容:

      第二種方法:


      <%
      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
      %>

      請作者聯(lián)系本站,及時附注您的姓名。聯(lián)系郵箱:mb5u#vip.qq.com(把#改為@)。

      分享:ASP基礎(chǔ)教程之ASP程序?qū)ookie的處理
      cookie常用來對用戶進(jìn)行識別。 實(shí)例: 以下為引用的內(nèi)容: <% dim numvisits response.cookies("NumVisits").Expires=da

      來源:模板無憂//所屬分類:ASP教程/更新時間:2008-08-22
      相關(guān)ASP教程