<rule name="UreRedirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
</conditions>
<action type="Redirect" url="https://example.com/{R:1}" redirectType="SeeOther" />
I am using above web.config code that
- redirect http://example.com to https://example.com
- redirect http://www.example.com to https://example.com
- does not redirect https://www.example.com to https://example.com
I have all possible bindings added with IIS
SSL is configured for example.com but not with www.example.com
I tried these links but these are irrelevant
iis url redirect http to non www https
How to redirect http to https and www to non-www via web.config?