응용

HTTP ---> HTTPs 리디렉트, IIS

T8.CO.KR 2026. 10. 10. 16:34

IIS URL 재작성 모듈이 설치돼 있어야 한다.

web.config를 편집한다.

 

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

<configuration>

    <system.webServer>

        ㆍㆍㆍ

        <rewrite>

            <rules>

                <rule name="HTTP to HTTPs Redirect" stopProcessing="true">

                    <match url="(.*)" />

                    <conditions>

                        <add input="{HTTPS}" pattern="^OFF$" />

                    </conditions>

                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />

                </rule>

            </rules>

        </rewrite>

        ㆍ ㆍ  ㆍ

    </system.webServer>

</configuration>