Knowledgebase: Windows Reseller Plesk
IIS Force Redirect to HTTPS
Posted by PremiumReseller 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>
(5 vote(s))
This article was helpful
This article was not helpful