Rewrite rule error: HTTP Error 500.50 - URL Rewrite Module Error. The expression “https://abc.com/{R:1}” cannot be expanded

后端 未结 2 1363
梦毁少年i
梦毁少年i 2021-02-18 22:13

Whenever someone makes request over HTTP protocol I rewrite the url to make it HTTPS. This is the code in web.config:

&         


        
2条回答
  •  爱一瞬间的悲伤
    2021-02-18 22:36

    The matches are zero based.

    
    

    Won't work because you only have one match. You need:

    
    

    Also, this won't work, because you can only match on the path below the site root.

    
    

    It looks like you are checking for ssl. Try this instead:

          
            
          
    

提交回复
热议问题