The target IIS serves multiple domains via multiple sites and host header binding. So far when a new site (domain) was added I could create a specific rule for that domain to redirect example.com requests to www.example.com.
<rule name="Redirect to www" stopProcessing="true">
<match url="(.*)" />
<conditions >
<add input="{HTTP_HOST}" pattern="^example.com" />
</conditions>
<action type="Redirect"
<-- it is OK to hardcode https, because http->https rewrite rule also in effect --!>,
url="https://www.example./{R:1}" />
</rule>
Question
Besides I am not sure the rule/condition/action above is entirely correct, now I would like to improve the solution to one universal rewrite rule. How can I add an universal global rule what will apply to all (future) domains, and redirects anysld.anytld/anyremainingpathandqueryandwhoknowswhat to www.anysld.anytld/anyremainingpathandqueryandwhoknowswhat?