Redirect HTTP to HTTPS in IIS 7

                       It is quite often that we host websites initially as HTTP sites in IIS and suddenly one day, the IT security geek comes and say that the website needs to be run in HTTPS.

There are a few methods by which this could be achieved.

The one method I'm gonna share with you in this blog is the redirection using URL Rewrite Module. This is an IIS module which will be available for download from this Microsoft site.

Once installed, the plugin will be available under the options of a website.

Double click on the URL Rewrite icon.

In the new window, click the Add Rules button on the right top of the page.

 In the window to add the new rule, select the option 'Blank Rule' and give a name to the new Inbound rule.
Give, (.*) as the pattern

Under Conditions, add the below:

Condition Input - {HTTPS}
Check if input string - Matches the Pattern
Pattern - ^OFF$


Under Action add the below:

Action Type            - Redirect
Action Properties    - https://{HTTP_HOST}/{R:1}
Redirect Type          - Found(302)

Once completed configuring the URL Rewrite Module, import the SSL/Certificate to the server and modify the Bindings of the website and add the HTTPS protocol, map to the new certificate.


Popular posts from this blog

VMware and Windows Interview Questions: Part 2

VMware and Windows Interview Questions: Part 3

VMware vMotion error at 14%