IIS 8

in Ops

Redirect HTTP to HTTPS with URL rewrite module in IIS

First download Microsoft’s Web Platform Installer 5.0. It’s a free tool that makes getting the latest components for Internet Information Services (IIS) easy. In Web Platform Installer search for ‘url rewrite’ and and install the one and only search result ‘URL Rewrite 2.0’. Restart IIS in order to make URL Rewrite module visible as shown below.

IIS URL Rewrite module

Create a new blank rule with the following adjustments (leave default values):

  • Title: e.g. ‘Redirect to HTTPS’
  • Match URL: Request URL matches the pattern using regular expressions. Pattern: (.*)
  • Conditions: Add new. Condition input {HTTPS}, pattern ^OFF$
  • Action: Action type Redirect, Redirect URL https://{HTTP_HOST}/{R:1} redirect type 303

Apply and go back to rules overview.

IIS URL Rewrite module

Don’t forget to clear ‘Require SSL’ checkbox in SSL settings in order to make the redirect working properly.