Knowledgebase: WebsitePanel
IIS Force Redirect to HTTPS
Posted by Premium Reseller on 19 December 2012 11:25 PM

You can add configuration in web.config file to force redirect to https

Rewrite rule to be added under <system.webServer> </system.webServer>

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

               <rule name="Redirect to https">
               <match url="(.*)" />
                <conditions>
                    <add input="{SERVER_PORT}" pattern="443" negate="true" />
                </conditions>
                 <action type="Redirect" url="https://www.yourdomain.com/{R:1}" />
              </rule>
            </rules>

        </rewrite>

    </system.webServer>

</configuration>

<system.webServer>
(6 vote(s))
This article was helpful
This article was not helpful