I'm upgrading a Win 2003 box that uses Helicon's ISAPI_REWRITE over to a Win 2012 box (IIS 8.5) and looking at URL Rewrite 2.0 as the replacement.
One of my rules was recursive to allow an unlimited number of key/value pairs in the URL to be converted into the querystring values passed to the .aspx page.
URL Rewrite 2.0 has a handy import feature but it doesn't like the flag that made the rule recursive. I say recursive in that it processed one pair of key/value into a rewrite then passed that rewrite back into the engine where it was picked up by the same rule if there were more pairs, or into a final rule where all that rewriting was passed to its final form.
Here are my rules from Helicon - which I understand were similar in syntax to the apache rules, with exception of the flag that made it recursive (NS)
#Allow for /flag/key/value/key/value for .NET - using /mci as the flag
RewriteRule ([^?]*/mci)(\?[^/]*)?/([^/]*)/([^/]*)(.*/[^?/]+\.html) $1(?2$2&:\?)$3=$4$5 [NS,I]
RewriteRule ([^?]*)/mci(\?[^/]*)?/([^?/]+)\.html $1/$3.aspx$2 [I,L]
This allowed:
http://www.whatever.com/subdir/mci/g/5/i/200/c/cookies/blah.html
To be rewritten into:
http://www.whatever.com/subdir/blah.aspx?g=5&i=200&c=cookies
URL Rewrite 2.0 complains about the (NS) flag but I cannot find another setting that says "pass this rewrite back through the rule engine from the beginning after you're done with this rule" - or preferred "keep processing this rewrite until it no longer matches the pattern."
Any help appreciated. I saw I could write my own provider but I'd think this sort of solution would be needed by more than just me.