How to Redirect website from HTTP to HTTPS on IIS7

How to configure IIS Redirect HTTP to HTTPS

To Configure IIS7 ,IIS8 to force using HTTPS for website follow these steps

  1. Make sure that Microsoft URL Rewrite Module installed on your server
  2. Install your SSL certificate in IIS 7 and bind it to your website or if you already install the SSL you can skip this step.
  3. Make sure Require SSL is NOT checked under SSL Settings for your website (uncheck the boxes that are checked in this screenshot)


    IIS Redirect HTTP to HTTPS

  4. Locate your web.config file on your root folder of your website and edit the file and locate <system.webServer> section and add the following after that section

    <rewrite>

    <rules>

    <rule name=”http to https” stopProcessing=”true”>

    <match url=”(.*)” />

    <conditions>

    <add input=”{HTTPS}” pattern=”^OFF$” />

    </conditions>

    <action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”Temporary” />

    </rule>

    </rules>

    </rewrite>

  5. Now you can check if your website by enter www.youdomain.com in the browser ,It should redirect to the https version.

1,352 total views, 3 views today

How to Redirect website from HTTP to HTTPS on IIS7
4.5 (90%) 2 votes

Leave a Reply

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

*