Let's Encrypt Windows redirect Print

  • 1

If you are going to use automatic redirect from http to https, please make sure that you add exception for ".well-known” directory used by Let’s Encrypt for certificate renewals. If you fail to setup the exception Let’s Encrypt Certificate is not going to be renewed automatically.

 

Below you can find an example of redirect rules:

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

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

                <rule name="Allow LetsEncrypt" patternSyntax="Wildcard" stopProcessing="true">

                    <match url="*/.well-known/*" />

                    <action type="None" />

                </rule>

                <rule name="Redirect HTTP to HTTPS" patternSyntax="Wildcard" stopProcessing="true">

                    <match url="*" ignoreCase="false" />

                    <conditions>

                        <add input="{HTTPS}" pattern="off" />

                    </conditions>

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

                </rule>

            </rules>

        </rewrite>

    </system.webServer>

</configuration>


Was this answer helpful?

« Back