HTTP to HTTPS automatic redirection in IIS 8

Some syntax changes in the latest IIS 8 concerning the URL Rewrite plugin caused issues when transitioning from IIS 7.5.

application_request_routing

In The site Application Request Routing plugin pane, open up “Server Proxy Settings…” on the left, then enable the server proxy:

application_request_routing_2

 

Back in the site you are configuring, create a new URL rewrite rule:

application_request_routing_3

 

The filter should match anything coming into the site, check to see if it is HTTPS, and if not redirect it. The Conditions section is where the pattern syntax had to be altered from what I had read from other sources. Previously regular expressions were used to the effect of “^0$”, a string that would not work in IIS 8. The filter should simply be “off”.

application_request_routing_4

Further down on the rule set the new URL to be the previous one except with HTTPS on the front of it. The {HTTP_POST}{R:1} help recreate the URL originally being visited before the redirection. After the rule is created trying to get to http://mattlapaglia.com redirects to https://mattlapaglia.com !

Leave a Reply

Your email address will not be published. Required fields are marked *