I've got the following routes:
// Submission/*
routes.MapRoute(
"Submission",
"Submission/{form}",
new { controller = "Submission", action = "Handle", form = "" });
// /<some-page>
routes.MapRoute(
"Pages",
"{page}",
new { controller = "Main", action = "Page", page = "Index" });
The first routes requests exactly as per this question. The second generically routes a bunch of static content pages. For instance localhost/Help, localhost/Contact, etc. all route to the MainController which simply returns the view according to the page name:
public class MainController : Controller
{
public ActionResult Page()
{
var page = (string)RouteData.Values["page"];
return View(page);
}
}
The problem is, during testing at least, localhost/ gives a dir listing instead of routing to Main/Index.aspx. The real problem is it fubars my SiteMap menu because the URLs aren't matching what's defined in the Web.sitemap file. localhost/Index does give me the correct view, however.
The curious thing is this works as expected on Mono / XSP.