I have a very simple URL Rewrite redirect rule that results in an infinite loop. When it fails a "Can't display page" error is displayed. Any error trapping tips or script modifications would be appreciated.
<rewrite>
<rules>
<rule name="Test redirect" enabled="false" stopProcessing="true">
<match url=".*" />
<action type="Redirect" url="/pub/" appendQueryString="false" logRewrittenUrl="true" redirectType="Permanent" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^mydomain.*(com|net)$" />
</conditions>
</rule>
</rules>
</rewrite>
- The rule is located in the wwwroot folder web.config file.
- The rule redirects to an MVC application in the wwwroot/pub/ folder.
- The IIS log is showing that the /pub/ folder is being called multiple times in the loop until the request is terminated by IIS.
- If the rule is disabled and I enter the URL directly it works fine.
- The same error is seen on different browsers.
It is not a browser cache issue.