.NET http跳转https
要怎么来实现,就是一输入http://www.xx.com自动跳转到 https://www.xx.com

解决方案 »

  1.   

    if (!Request.IsSecureConnection)
    {
        // send user to SSL 
        string serverName =HttpUtility.UrlEncode(Request.ServerVariables["SERVER_NAME"]);        
        string filePath = Request.FilePath;
        Response.Redirect("https://" + serverName + filePath);
    }
    也可以参考这个
      

  2.   

    这个方法不行,因为这个要打开才行,问题是没打开就已经出错了,让加https
      

  3.   

    楼主,我找了半天,终于找到了:http://www.myssl.cn/guide/faq_always_https.asp
      

  4.   

    那个asp.net 的代码怎么实现呢?