是不是在Global.asax 中 或者用Url重写来实现呢?
还是要通过服务器中的DNS设置?
操作方法是怎样的?

解决方案 »

  1.   

    在网站的虚拟主机的主机头上绑定域名:用户名.xxx.com
    这种方法可以用程序实现,不过很复杂。
      

  2.   

    wxpisp(Daniel Wang) ( ) 信誉:99  2006-4-27 2:49:40  得分: 0  
     
     
       
    在网站的虚拟主机的主机头上绑定域名:用户名.xxx.com
    这种方法可以用程序实现,不过很复杂。  
     
    ---- 这样做是手动的,得一个个去绑定,这个方法不行
      

  3.   

    可以哦
    用下面的代码sURL=Request.ServerVariables("HTTP_HOST")
    first_name=split(sURL,".")
    if ubound(first_name)>2 then 
    Response.Status= "404 no found"
    Response.End 
    end ifuser_id=first_name(0)这样取出的user_id就是用户名了
    ^_^
      

  4.   

    1,你的站点是默认站点(主机头为空的站点) 然后通过urlrewrite实现
    2,你的站点不是默认站点(主机头为空的站点),需要给每个用户加主机头,然后通过urlrewrit实现
      

  5.   

    默认站点,主机头为空这样任何指向你服务器IP的域名都能访问该站点然后在首页判断域名,根据域名不同给出不同路径即可dim Domain
    Domain=Request.ServerVariables("http_host")
    select case Domain
    case "Ai169.Com"    response.redirect "Www.Ai169.Com"
    case "123.Ai169.Com"   response.redirect "123/Index.html"
    case "asp.Ai169.Com"   response.redirect "asp.html"
    case "Home.Ai169.Com"   server.transfer "Index.html"
    case "219.133.197.221"  server.transfer "HTTP404/403.htm"
    end select
      

  6.   

    我晕, 是不是csdn的bug
    帖子放得太久,再然再 管理 给分结帖
    就超时出错,之后,看前台都是0分,在管理里面都有给分....
    管理里面如下:
      回复人:wxpisp(Daniel Wang) () 信誉:99  2006-4-27 2:49:40  得分: 5 删除  
     
      在网站的虚拟主机的主机头上绑定域名:用户名.xxx.com  
    这种方法可以用程序实现,不过很复杂。  
     
      回复人:kandyasp(世纪外卖网[http://www.waimai21.com/sitelink.aspx]) () 信誉:100  2006-4-27 9:03:18  得分: 5 删除  
     
      要做泛域名需要独立IP地址的主机  
     
      回复人:Devin_lee(感觉) () 信誉:98  2006-4-27 14:59:09  得分: 0 删除  
     
      有单独的服务器以及IP  
    域名也支持泛解析  
    求解决方法  
     
      回复人:Devin_lee(感觉) () 信誉:98  2006-4-27 15:00:56  得分: 0 删除  
     
      wxpisp(Daniel  Wang)  (  )  信誉:99    2006-4-27  2:49:40    得分:  0      
       
       
           
    在网站的虚拟主机的主机头上绑定域名:用户名.xxx.com  
    这种方法可以用程序实现,不过很复杂。  
     
         
       
    ----  这样做是手动的,得一个个去绑定,这个方法不行  
     
     
     
      回复人:ufqj(网络人) () 信誉:100  2006-4-27 15:24:33  得分: 10 删除  
     
      可以哦  
    用下面的代码  
     
    sURL=Request.ServerVariables(  "HTTP_HOST  ")  
    first_name=split(sURL,  ".  ")  
    if  ubound(first_name)  >2  then    
               Response.Status=    "404  no  found  "  
               Response.End    
    end  if  
     
    user_id=first_name(0)  
     
    这样取出的user_id就是用户名了  
    ^_^  
     
      回复人:xiahouwen(武眉博<活靶子.NET>) () 信誉:105  2006-4-27 15:30:11  得分: 10 删除  
     
      1,你的站点是默认站点(主机头为空的站点)  然后通过urlrewrite实现  
    2,你的站点不是默认站点(主机头为空的站点),需要给每个用户加主机头,然后通过urlrewrit实现  
     
      回复人:HAVENT(♂夜雨流星♂) () 信誉:100  2006-4-27 15:33:40  得分: 10 删除  
     
      默认站点,主机头为空  
     
    这样任何指向你服务器IP的域名都能访问该站点  
     
    然后在首页判断域名,根据域名不同给出不同路径即可  
     
    dim  Domain  
    Domain=Request.ServerVariables(  "http_host  ")  
     
     
    select  case  Domain  
    case    "Ai169.Com  "        response.redirect    "Www.Ai169.Com  "  
    case    "123.Ai169.Com  "      response.redirect    "123/Index.html  "  
    case    "asp.Ai169.Com  "      response.redirect    "asp.html  "  
    case    "Home.Ai169.Com  "      server.transfer    "Index.html  "  
    case    "219.133.197.221  "    server.transfer    "HTTP404/403.htm  "  
    end  select  
     
      回复人:Devin_lee(感觉) () 信誉:98  2006-4-27 17:21:48  得分: 0 删除  
     
      啊,大概明白了....  
     
      回复人:wxpisp(Daniel Wang) () 信誉:99  2006-4-27 17:46:34  得分: 0 删除  
     
      明白了就给分哈。  
     
      回复人:Devin_lee(感觉) () 信誉:98  2006-4-27 17:46:57  得分: 0 删除  
     
      奇怪,已经给分了,怎么都是0分  
      

  7.   

    已问题报告csdn,让他们来给分吧