I need to separate some of the functionality from the old ISAPI library into another solution (most likely ASP.NET MVC). Rewriting the IIS7 URL sounds like the perfect candidate for the job, but it turns out I can't find a way to configure the rules the way I need. I need to write a rule that checks the contents of an HTTP message for a specific value.
i.e.
<form method="post" action="legacy_isapi.dll">
<input name="foo" />
</form>
if (Request.Form["foo"] == "bar")
Context.RewritePath("/some_other_url/on_the_same_machine/foo/bar");
As a proof of concept, I was able to create an IHttpModule that parses the collection context.Request.Form and performs rewriting when certain parameters are available. I installed this module on my website and it works.
Instead of configuring the module, I would rather extend the existing Rewrite URL module to support checking the contents of HTTP Post as one of its rules. Is it possible?
source
share