ASP.NET MVC Areas: How to hide "Area" name in URL?

Posted by Mark Redman on Stack Overflow See other posts from Stack Overflow or by Mark Redman
Published on 2010-04-21T10:43:44Z Indexed on 2010/04/21 11:03 UTC
Read the original article Hit count: 849

When running the MVC 2 Areas example that has a Blog Area and Blog Controller the URL looks like this:

http://localhost:50526/Blog/Blog/ShowRecent in the format:

RootUrl / AreaName / ControllerName / ActionName

Having just discovered MVC Areas, it seem like a great way to organise code, ie create an Area for each section, which in my case each section has its own controller. This means that each AreaName = ControllerName. The effect of this is the double AreaName/ControllerName path in the Url eg /Blog/Blog/ above

Not having a complete clear understanding of routing, how could I setup routing to not show the AreaName?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-areas

Related posts about asp.net-mvc-routing