web.config redirect non-www to www

后端 未结 7 2090
北海茫月
北海茫月 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条回答
  •  旧时难觅i
    2020-11-28 05:27

    Other answers here are unnecessary long, here's the rule i use (just copy and paste) :

    
      
      
        
      
      
    
    

    This will redirect to the www version while preserving the HTTP and HTTPS protocol

    Hope this helps.

提交回复
热议问题