Asp.net Redirecting from Https to Http

前端 未结 5 475
长情又很酷
长情又很酷 2020-12-21 15:45

I am trying to redirect from secure (https) to http when user login. It redirects fine but for some reason its keeping the https.

 Response.Redirect(Redirect         


        
5条回答
  •  醉话见心
    2020-12-21 16:07

    disclaimer - I was involved in the development of this project

    I would recommend using http://nuget.org/packages/SecurePages/ It gives you the ability to secure specific pages or use Regex to define matches. It will also force all pages not matching the Regex or directly specified back to HTTP.

    You can install it via NuGet: Install-Package SecurePages

    Docs are here: https://github.com/webadvanced/Secure-Page-manager-for-asp.net#secure-pages

    Simple Usage:

    SecurePagesConfiguration.Urls.AddUrl("/cart");
    

    or

    SecurePagesConfiguration.Urls.AddRegex(@"(.*)account", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline);
    

提交回复
热议问题