I am trying to enforce the www. subdomain url as canonical. Using the default settings in IIS with the rewrite module installed in IIS. Code is generated in my web.config by IIS or the rewrite module.
The code works for Microsoft edge, but every other browser mostly ignore the rewrite rules, yet occasionally abide by it.
I have cleared my caches in the browsers
My code looks like
<system.webServer>
<rewrite>
<rules>
<rule name="CanonicalHostNameRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.mydomain.com$" negate="true" />
</conditions>
<action type="Redirect" url="h t t p:// www.mydomain.com/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
8