I have a website whose name I am changing from example.com to newexample.com. My thought process (please comment on this as well, as my approach may be incorrect) was to configure permanent a redirect from http:(s)://.example.com/ (I am not using '' in the literal regex sense here) to https://www.newexample.com/.
In the rewrite rules section I took the following approach:
<rewrite>
<rules>
<rule name="Redirect to newexample.com">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern=".*" negate="true" />
</conditions>
<action type="Redirect" url="https://www.newexample.com/{R:0}" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
The way I understand the above rules is that ANY host name will get redirected to "https://www.newexample.com/whatever", leaving all other aspects of the requested url as-is, but I am not getting redirected using any combination that I've tried so far.