title: ASP.NET MVC 3.0 Url Rewritng
body: <p>I have Action called Contact in home controller</p>
  
  <pre><code>&lt;mysite&gt;/Home/Contact
  </code></pre>
  
  <p>I want to be able by typing <code>&lt;mysite&gt;/Contact</code> to get the same result as <code>&lt;mysite&gt;/Home/Contact</code></p>
  
  <p>Is it possible to do with mvc 3.0 routes or RouteMagic?</p>
  
  <p>Currently i am trying to achieve this like that, but no luck:</p>
  
  <p>Custom Routes:</p>
  
  <pre><code>routes.MapRoute(
                  "Contact", // Route name
                  "Contact", // URL with parameters
                  new { controller = "Home", action = "Contact", id = UrlParameter.Optional } // Parameter defaults
              );
  </code></pre>
  
  <p>RouteMagic:</p>
  
  <pre><code> var route = routes.MapRoute("new", "Contact");
              routes.Redirect(r =&gt; r.MapRoute("old", "Home/Contact"))
                .To(route);
  </code></pre>
  
  <p>Update</p>
  
  <p>Ok the custom routes should be defined first, now it is working(in case of custom routes), but there is appeared a new question <code>why route magic returning error</code>:</p>
  
  <pre><code>Server Error in '/' Application.
  Value cannot be null or empty.
  Parameter name: controllerName
  </code></pre>