iis url redirect http to non www https

前端 未结 5 957
半阙折子戏
半阙折子戏 2020-12-03 05:42

i need to redirect from

www.domain.de to https://domain.de -works

http://www.domain.de to https://domain.de -works

http://domain.de to https://domain

5条回答
  •  难免孤独
    2020-12-03 06:28

    I think this will work for you, the search pattern has the optional www and redirects using the back reference C:2, the rule has a condition to only run against non https.

    This is the pattern:

    "^(www\.)?(.*)$"
    

    where:

    {C:0} - www.domain.de
    {C:1} - www.
    {C:2} - domain.de
    

    Here's the rule in full:

      
        
          
            
            
              
              
            
            
          
        
      
    

提交回复
热议问题