I am trying to setup URL Rewrite on my IIS so that it handles http and let's encrypt. My goal is the following
1) All traffic to http://example.com, http://www.example.com and https://www.example.com should redirect (301) to https://example.com
2) Any subpage and querystring should be kept so that http://www.example.com/whatever/login.aspx?username=blabla would become https://example.com/whatever/login.aspx?username=blabla
3) All requests to http://example.com/.well-known/acme-challenge/* and http://www.example.com/.well-known/acme-challenge/* (where "*" can be whatever subpage and querystring) should NOT be redirected
It is like I have tried everthing but I cannot make it work.