Излишнее перенаправление HTTPS на HTTP обратно на HTTPS - PullRequest
0 голосов
/ 13 марта 2019

У меня проблемы с решением проблемы перенаправления для моего веб-приложения.Когда вводится открытый URL-адрес example.com, он перенаправляется на https, затем на http, а затем на https.Я пытаюсь ограничить количество переадресаций и заставить сайт перейти с https://example.com на https://www.example.com без http в середине.

<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="Redirect to www" stopProcessing="true">
              <match url="(.*)" />
              <conditions trackAllCaptures="true">
                <add input="{CACHE_URL}" pattern="^(.+)://" />
                <add input="{HTTP_HOST}" pattern="^example\.com$" />
              </conditions>
              <action type="Redirect" url="{C:1}://www.example.com/{R:1}" />
            </rule>
            <rule name="Rewrite to index.php">
                <match url="index.php|images|test.php" />
                <action type="None" />
            </rule>
            <rule name="Rewrite CI Index">
                <match url=".*" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html|txt|xml" negate="true" />
                </conditions>
                <action type="Rewrite" url="index.php/{R:0}" />
            </rule>
            <rule name="LowerCaseRule1" stopProcessing="true">
                <match url="[A-Z]" ignoreCase="false" />
                <action type="Redirect" url="{ToLower:{URL}}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>

screenshot of my redirect problem

...