Take the 2-minute tour ×

I don't want to use the default route that vs.net creates:

    "Default",                                             // Route name

I only want the route to get the www.example.com/ page, what is it? (note: I don't want www.example.com/default just the plain www.example.com to map to HomeController Action=Index).

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I just started playing around with MVC yesterday (the beta version) and I have this in my web config (for IIS 6.0, remove the .aspx for IIS 7.0)

public static void RegisterRoutes(RouteCollection routes)
            routes.MapRoute("Default", "{controller}.aspx/{action}/{id}", new { controller = "Home", action = "Index", id = "" });
            routes.MapRoute("Empty", "", new { controller = "Home", action = "Index", id = "" });
share|improve this answer
thanks! Is "Empty" hard coded in MVC or what? –  Brian Leahy Nov 24 '08 at 3:05
Arbitrary name. I also experimented with "Default2", "Blank", etc... and liked "Empty" the best. :P –  Chris Nov 24 '08 at 3:52
add comment

Your Answer

