web.config redirect non-www to www

后端 未结 7 2089
北海茫月
北海茫月 2020-11-28 05:01

I need to redirect non-www urls to www url for both http and https urls. I tried following rules in web.config.



        
7条回答
  •  伪装坚强ぢ
    2020-11-28 05:28

    This post is basically for those who need to redirect non-www to www URL in windows hosting.

    In web.config file as below code:

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    In the above code please note there are two rules used one for http and another for https. To avoid clashing of http and https in the same rule, here used two separate patterns.

    I hope it works for you guys…!!

提交回复
热议问题