Redirect HTTP to HTTPS with IIS 7

In order to Redirect HTTP to HTTPS on your site, please follow the instructions below to allow this functionality.

1. Connect to your site using the IIS7 Manager.

2. Once you have connected to your site with IIS7 Manager, open the URL rewrite Snap-In and create a new rule with the parameters outlined in the illustration below:




As an alternative, you can manually edit the web.config file in your site and add the following syntax to accomplish the same task:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
              <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                 <match url="(.*)" />
                   <conditions>
                       <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                  </conditions>
                <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
             </rule>
           </rules>
        </rewrite>
    </system.webServer>
</configuration>


Add Feedback