1,746 questions
Hi @aywsdown
You should use two rules to achieve this. one for http to https and another one for https non-www to https www.
<rule name="http to https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTP_HOST}" pattern="^(www\.)?example.com" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" redirectType="Temporary" />
</rule>
<rule name="non-www to www" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="example.com" />
<add input="{HTTPS}" pattern="^on$" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" />
</rule>
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.