NayuaHOUSE
New Member
If the request URI that IIS has received needs to be redirected or rewritten, on condition that it matches a regex patten, what are a couple "easy" recommended places to hook the request/response sequence to supply a redirect or rewrite before I have reached an MVC controller/action?I see someone has an HttpModule urlRewrite approach. Others have used some more precarious techniques. One approach that I like, if it works, is to make my own IRouteHandler:\[code\]routes.Add("Hello", new Route("<regex>", new MyCustomRouteHandler()));\[/code\]MyCustomRouteHandler could then return a custom IHttpHandler, which then could perform a redirect or urlRewrite. I'd like comments on these various approaches, perhaps with some fleshing-out. For example, if others agree the custom IRouteHandler / IHttpHandler is the way to go, what should that code look like (particularly the HttpHandler code)? It bugs me to think there is an easier way to use the routing mechanism to achieve this goal, but it eludes me. Thoughts?If all the approaches become too ugly, then I may just fall-back to assume that the IIS_rewrite module is installed, and use this approach.