0
votes

I tried to make http automaticlly redirect to https.

I exactly followed those steps: https://www.namecheap.com/support/knowledgebase/article.aspx/9953/38/iis-redirect-http-to-https

This is my web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="SSL Redirect" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent"/>
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

The error I get when visiting the site is ERR_TOO_MANY_REDIRECTS

1

1 Answers

0
votes

I found a solution that works if you are using Cloudflare

On cloudflare you can just select 'Automatic HTTPS Rewrites' and this will work.