I've been looking into the rewriter module a bit today, but there is something I can't seem to figure out. When I host my web application in IIS (5 to be exact on an XP system) and use the following configuration:
RewriteRule ^/article/(.*)/(.*).aspx /default.aspx?articleid=$2 [NC,R=301]
RewriteRule ^/article/(\d+).aspx /default.aspx?articleid=$1 [NC,R=301]
Based on the mod_rewrite documentation (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html), more specifically, based on the description of the RewriteBase directive, I would have thought
that requesting the url: http://localhost/Rewriter/article/123.aspx would redirect to
http://localhost/Rewriter/default.aspx?articleid=123. This isn't the case however. The redirection is actually to
After stepping into the code, I noticed that in the RuleSet class the flags are being applied when you are able to execute a rule (in the method RunRules):
var flagResponse = temporyFlags.Apply(ruleContext);
When encountering a redirect flag it immediatelly redirects. Because the redict already happened, this also means that the code to add the base again is not being executed.
Now my question, is this behavior by design?
(PS The code base I evaluated was the change set 45203.)