Q:

MVC3 :: Using global.asax to direct a specific controller/action to a different controller/action

In an MVC3 app I have a view in my home controller that is accessed via the following URL:
http://mysite.com/home/mycontent
However, my user wants to accees it via:
http://mysite.com/mycontent (without a specific reference to the home controller)
I've tried modifying my global.asax with the following:
    routes.MapRoute(
        "MyContent", // Route name
        "MyContent", // URL with parameters
        new { controller = "Home", action = "MyContent"} // Parameter defaults
    );

But I get 404 errors when I try to use it.  Is there a way I can accomplish what my user is wanting to do - redirecting a URL to a specific controller/view pair?

A:

I think you should keep some "parameters":
routes.MapRoute(
        "MyContent", // Route name
        "{action}/{id}", // URL with parameters
        new { controller = "Home", action = "MyContent", id = ""} // Parameter defaults
    );

