I'm having an issue getting the following syntax to work:
<rewriter>
<!-- This does NOTHING -->
<if url="whywontthiswork\.aspx" rewrite="/default.aspx" />
<!-- This redirects correctly -->
<redirect url="whywontthiswork\.aspx" to="/default.aspx" />
</rewriter>
As noted, the first rule does nothing no matter what I try. The X-Powered-By field on the response for that page request always says "ASP.NET". However, the second rewrite rule always works, and the X-Powered-By field on the response for that request is "ASP.NET,UrlRewriter.NET 2.0".
I believe that IIS is configured properly because it is handling the request correctly for <redirect />
. The issue is that I don't have any ideas why the first rewrite rule would not execute.
I have tried to search the documentation on UrlRewriter.NET, but at this time, it seems their site if offline or no longer in service. Any ideas?
OK, sorry to answer my own question but I figured out the solution shortly after posting this. I most likely have a different version of UrlRewriter.NET than what was used when these rules were created. Updating the syntax to the following, solved the problem:
Edit:
I was able to confirm that our production environment was using Intelligencia.UrlRewriter version 1.7.0 but the assembly I was using was 2.0.