Securing your entire site using SSL and web.config

Please follow below steps to redirect http to https mode:

 

1. Please make sure IIS rewrite module is installed on your IIS service, it is default module for IIS 7.5 and onwards.

 

2. Edit web.config

 

2a. Between <system.webServer> tag

 

eg:

 

<system.webServer>

</system.webServer>

 

insert the IIS rewrite rules as below:

 

<system.webServer>

    <rewrite>

      <rules>

        <rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">

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

        <conditions logicalGrouping="MatchAny">

          <add input="{SERVER_PORT_SECURE}" pattern="^0$" />

        </conditions>

        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />

        </rule>

      </rules>

    </rewrite>

</system.webServer>

 

3. To edit config/shop$config.asp and <your_admin_folder>/config/shop$config.asp

 

3a. to modify xmysite and xssl as https://www.yourdomain.com