访问http://mobile.139.com这个2级域名的时候,就会自动转到
http://www.139.com/Skin/1/index.aspx?BlogId=20112上面这个地址,请问asp.net怎么重新http://xxx.abc.com到http://abc.com/index.aspx?id=xxx 呢

解决方案 »

  1.   

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            '在此处放置初始化页的用户代码
            Dim StrHTTP As String = Request.ServerVariables("http_host")
            Dim StrUrl As String
            If StrHTTP = "http://xxx.abc.com" Then
                StrUrl = "http://abc.com/index.aspx?id=xxx"
            else
            ..........................................
            End If
            Response.Redirect(StrUrl)
        End Sub
      

  2.   

    private void Page_Load(object sender, System.EventArgs e) 

     string StrHTTP = Request.ServerVariables("http_host"); 
     string StrUrl; 
     if (StrHTTP == "http://xxx.abc.com") { 
       StrUrl = "http://abc.com/index.aspx?id=xxx"; 
     } 
     else
     {
        ...
     }
     Response.Redirect(StrUrl); 
    }
      

  3.   

    jxufewbt(我的目标是5星) ,楼上的速度超快
      

  4.   

    <script>
    if(location.href='http://xxx.abc.com')
    {
       location='http://abc.com/index.aspx?id=xxx';
    }
    </script>