1. 论坛系统升级为Xenforo,欢迎大家测试!
    Dismiss Notice

不同目录绑域名

Discussion in '主机讨论' started by 小叶, Sep 7, 2005.

  1. 小叶

    小叶 New Member

    Joined:
    Sep 4, 2005
    Messages:
    17,941
    Likes Received:
    33
    1.首先你的虚拟主机要能支持绑定多个域名

    2.在index.asp中放入一段代码用以判断域名和转向到子目录


    PHP:
    <%
    Dim StrDomain
    StrDomain
    =Request.ServerVariables("SERVER_NAME")
    '获得包含域名的字符串 

    select case StrDomain
    case "www.aaa.com"
    Response.redirect "http://www.aaa.com/aaa/index.asp" 
    case "www.bbb.com"
    Response.redirect "http://www.bbb.com/bbb/index.asp" 
    case else
    Response.write "未知错误" 
    end select 
    %>  
     
  2. Tameway

    Tameway New Member

    Joined:
    Sep 6, 2005
    Messages:
    1,286
    Likes Received:
    8
    这样不是真正的绑定
    软转址功能~
    地址会转的
     
  3. 吴天

    吴天 New Member

    Joined:
    Sep 8, 2005
    Messages:
    16
    Likes Received:
    0
    把"Response.write"改成"Server.transfer "应该就可以实现了