How do I force all visitors of my website to use secure connection (HTTPS) ?

Windows:

Follow the steps from this article.

or

Create file web.config in document root of the domain and put following configuration inside:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="http to httpos" 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>
    </system.webServer>
</configuration>

Leave a Reply

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