I want to redirect non-www url to www. My site name looks like www.my-site.com i.e. contains a hyphen. Canonical domain name rule like this
<rules>
<rule name="CanonicalHostNameRule1">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.my-site\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.my-site.com/{R:1}" />
</rule>
does not work
When I use escape like “\-“ I got a redirection loop…
Can you guys please point me to the right direction?