Forum Discussion

anilkumar1575's avatar
anilkumar1575
Copper Contributor
May 24, 2021

Asp.net site hosted on IIS and https Redirect

Hello

 

Asp.net website hosted on IIS 10 and URL redirect only to https.

 <rewrite>
            <rules> 
                <rule name="Redirect HTTP to HTTPS" stopProcessing="true" enabled="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny" trackAllCaptures="true">
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
                </rule>
            </rules>
            <outboundRules>
                <rule name="Add the STS header in HTTPS responses">
                    <match serverVariable="RESPONSE_Strict_Transport_Security" pattern=".*" />
                    <conditions>
                        <add input="{HTTPS}" pattern="on" />
                    </conditions>
                    <action type="Rewrite" value="max-age=31536000;preload=true;" />
                </rule>
            </outboundRules>
        </rewrite>
 
it works with IE but Edge/chrome browser show this error message and then displays actual page.

Hmmm… can't reach this page. It looks like the webpage at https://URL might be having issues,
or it may have moved permanently to a new web address.ERR_UNEXPECTED

 

How to resolve this issue?

Thank you

 

No RepliesBe the first to reply

Resources