I am attempting to redirect anyone visiting a HTTPS page to a HTTP page however the rule seems to fail and not redirect the user at all i.e. displays an untrusted connection and if I accept the untrusted connection it returns a 404 page. The page I am attempting to redirect to exists.
Is there a way I can redirect a user from HTTPS to HTTP? The rule I have is
<rewrite>
<rules>
<rule name="Redirect to https">
<match url="(.*)" />
<conditions>
<add input="{SERVER_PORT}" pattern="443" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:1}" />
</rule>
</rules>
</rewrite>
There are a couple things to keep in mind. The request must first bind to the server before the redirect, so you can't avoid the untrusted connection except to make sure that you have a valid cert bound to the site. So a redirect won't help with that.
Your redirect url has https:// in it. Did you mean for it to be http://? It should target http.
And if you want to allow some pages to not redirect (like your login page), then you can add exclude conditions for {URL}, or do it in the match url="" section.