MVC RequireHttps entire site

前端 未结 9 1090
遇见更好的自我
遇见更好的自我 2020-12-23 13:24

I have read the previous posts about using the RequireHttpsAttribute to secure individual controllers:

ASP.NET MVC RequireHttps in Production Only

but is the

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-23 13:38

    I ended up using IIS URL Rewrite 2.0 to force the site to switch to HTTPS. This code in web.config does the trick:

      
        
        
          
            
              
              
                
              
              
            
          
        
      
    

提交回复
热议问题