i need to redirect from
www.domain.com
to https://domain.com
http://www.domain.com
to https://domain.com
http://domain.com
to https://domain.com
I have the following lines of code and it works fine
<system.webServer>
<rewrite>
<rules>
<rule name="SecureRedirect" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="^(www\.)?(.*)$" />
</conditions>
<action type="Redirect" url="https://{C:2}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
i take it from here
I want also rediredt from
https://www.domain.com
to https://domain.com
i add the following lines
<rule name="Remove WWW" stopProcessing="true">
<match url="^https://www.(.*)" />
<action type="Redirect" url="http://{R:1}" />
</rule>
but it no redirect from https://www.domain.com
to `https://domain.com
why?