2

<match url="(https?:\/\/(.+?\.)?domain1\.example I believe the url attribute matches URL-paths only, not the absolute URL, so this will never match. But if it did match, it's also matching https, which is not what you require. Try just adding another condition to your original rule that checks the HTTP_HOST for the specific domain. For example: <add ...


2

When you use a 301 (permanent) redirect, the browser caches this redirection and uses it further on. So the change won't be visible for people that have already visited the URL before since they are going to be redirected to the HTTP version that you used in the first place. New visitors will follow the new redirection. However, a best practice is to force ...


1

<match url="*example.com/default.htm" ignoreCase="true" /> I think the url attribute matches against the URL-path only, not the hostname. So the above should read: <match url="^default\.htm" ignoreCase="true" /> This matches "default.htm" in the document root, or use the pattern default\.htm to match "default.htm" anywhere. This uses ...


1

I have found an answer from another question that I tried and it seems to have worked. If there is a better solution, please provide your solution as well. <rule name="Force WWW and SSL" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^[^www]" /&...


Only top voted, non community-wiki answers of a minimum length are eligible