How to Redirect Http to HTTPS on a non standard port on IIS using URL ReWrite

The standard way in IIS to redirect HTTP to https will not work because http_host contains the port

You need to use Regex Magic :

               <rule name=”HTTP to HTTPS on different SSL Port” enabled=”true” stopProcessing=”true”>
                    <match url=”(.*)” ignoreCase=”true” />
                    <conditions logicalGrouping=”MatchAll” trackAllCaptures=”true”>
                        <add input=”{HTTPS}” pattern=”off” />
                        <add input=”{HTTP_HOST}” pattern=”([^/:]*?):[^/]*?” />
                    </conditions>
                    <action type=”Redirect” url=”https://{C:1}:8889/{R:0}” appendQueryString=”false” />
                </rule>

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...