【问题标题】:.asax.cs page is appending :443 to URLs.asax.cs 页面将 :443 附加到 URL
【发布时间】:2018-03-26 15:20:35
【问题描述】:

我不熟悉 ASP 或 C#,但我遇到了一个难题,在强制 SSL /Mobile 视图 URL 后附加:443。例如用户将被服务https://www.example.com/Mobile:443/ 代替 : https://www.example.com/Mobile

我认为这是 global.asax.cs 页面中的相关代码部分:

            if (!isOnMobilePage && !isOnMobilePageJSLib && !isOnMobilePageImages && !isOnMobilePageContent && !isOnMobilePageScripts && !isOnMobilePageJS && !isOnMobilePagescrollbar && !isOnMobilePagefonts)
            {
                string URL1 = Context.Request.Url.AbsoluteUri.ToString();
                Uri uri1 = new Uri(URL1);
                UriBuilder builder1 = new UriBuilder(uri1);
                builder1.Host = builder1.Host + "/Mobile";

                Uri result1 = builder1.Uri;
                URL1 = result1.AbsoluteUri.ToString();
                string redirectTo1 = URL1.Replace(":80", "");

               HttpContext.Current.Response.Redirect(redirectTo1);
            }

你们都是?????????????????????s

【问题讨论】:

    标签: c# ssl https


    【解决方案1】:

    443 是 SSL 端口。要删除它,请尝试

      builder1.Port = -1;
    

    在添加 /Mobile 之前

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-24
      • 2018-05-23
      • 2020-03-08
      • 1970-01-01
      • 2010-10-12
      • 2018-05-15
      • 2018-02-21
      • 1970-01-01
      相关资源
      最近更新 更多