Account for simple url rewriting in ASP.NET MVC redirect
How would you go about redirecting in ASP.NET MVC to take into account some external URL rewriting rules.
For example:
- What the 开发者_StackOverflow社区user enters: http://www.example.com/app/route
- What ASP.NET MVC sees: /route
- What I want to redirect to: http://www.example.com/app/other_route
- What actually happens when I do a simple RedirectToAction: http://www.example.com/other_route (which doesn't exist, from the outside anyway)
This seems like it should be simple, but I'm drawing a blank.
Just use
RedirectToAction("NewAction", "Controller-Required-If-Diferent-From-Current-Controller");
精彩评论