asp.net 4.7 (yeah, it’s one of those projects)
iis 10.0.* whatever
client wants few pages on different domain, so we create a new DNS name, point it to old site.
he wants:
- newsite.com/page1 to rewrite to oldsite.com/pageA
- newsite.com/page2 to rewrite to oldsite.com/pageB
so, for first case, i have a fairly simple rewrite rule:
<rule name="testrewrite" stopProcessing="true">
<match url="page1$" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?newsite.com$" />
</conditions>
<action type="Rewrite" url="https://oldsite.com/pageA" />
</rule>
and this results in TOO_MANY_REDIRECTS error.
Please note that REDIRECTS work normally, as expected.
made sure redirect module is installed.
there aren’t any rules that might contest with the new one. the newsite.com domain is not mentioned anywhere else. also, there’s stopProcessing, and the rewrite rule is handled first