I am using the DNN CMS that allows multiple portals (many websites) under 1 IIS website. In this situation I cannot use the standard canonical rule below because I have multiple bindings for different domains but am getting errors on Google search console because I don't have a canonical rule. How can I modify my rule to account for the multiple domains?
<rule name="CanonicalHostNameRule1" enabled="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^mydomain1\.com$" negate="true" />
<add input="{HTTP_HOST}" pattern="^(.*)\.mydomain1\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://mydomain1.com/{R:1}" />
</rule>
If in my bindings I had:
www.mydomain1.com
mydomain1.com
www.exampledomain.com
exampledomain.com
www.thirddomain.com
thirddomain.com
I would like to set the www. versions of all my domains as the canonical target but each domain should have it's own not 1 globally.
Is it just a matter of adding more input's to that rule? IE:
<add input="{HTTP_HOST}" pattern="^thirddomain\.com$" negate="true" />
----- ADDITIONAL INFO --------
In one rule I need requests to
mydomain1.com sent to www.mydomain1.com
exampledomain.com sent to www.example.com
thirddomain.com sent to www.thirddomain.com