Q:

MVC 3 route mapping

I have 2 routes mapped in my mapping...
this is to allow a user to type in the url with an optional parameter to quick load their town in the home page of the website, example:
www.mysite.com/manchester
www.mysite.com/liverpool
or to simply go to the defaul home page if www.mysite.com is entered with nothing else.
With the default mapping in place to handle the controller/action/parameter i have added an additional route so the parameter is handed:
routes.MapRoute(
    "Default", // Route name
    "{controller}/{action}/{id}", // URL with parameters
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }); // Parameter defaults

routes.MapRoute(
    "HomePageQuickFind",
    "{quickFind}",
     new { controller = "Home", action = "Index", quickFind = UrlParameter.Optional });

I am not very good with route mapping as I am struggling to understand it and my question is this a bad approach which my cause "greedy routing" and is there another way of implementing my scenario?

A:

I think you need to replace the default route with a set of routes for each of your controllers, then add your quick find route as the last route. This should allow any unmatched routes to fall through to the quick find route. Try something like this:
// Routes for standard controllers
routes.MapRoute(
    "Home",
    "home/{action}/{id}",
    new { controller = "home", action = "index", id = UrlParameter.Optional }
);
routes.MapRoute(
    "Map",
    "map/{action}/{id}",
    new { controller = "map", action = "index", id = UrlParameter.Optional }
);
routes.MapRoute(
    "Default",
    "users/{action}/{id}",
    new { controller = "users", action = "index", id = UrlParameter.Optional }
);

// Route for www.mysite.com/cityname
routes.MapRoute(
    "QuickFind",
    "{quickFind}",
    new { controller = "home", action = "index", quickFind = UrlParameter.Optional }
);

