title: ASP.NET MVC twitter/myspace style routing
body: <p>This is my first post after being a long-time lurker - so please be gentle :-)</p>
  
  <p>I have a website similar to twitter, in that people can sign up and choose a 'friendly url', so on my site they would have something like:</p>
  
  <p>mydomain.com/benjones</p>
  
  <p>I also have root level static pages such as:</p>
  
  <p>mydomain.com/about</p>
  
  <p>and of course my homepage:</p>
  
  <p>mydomain.com/</p>
  
  <p>I'm new to ASP.NET MVC 2 (in fact I just started today) and I've set up the following routes to try and achieve the above.</p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
          routes.IgnoreRoute("content/{*pathInfo}");
          routes.IgnoreRoute("images/{*pathInfo}");
  
          routes.MapRoute("About", "about",
              new { controller = "Common", action = "About" }
          );
  
          // User profile sits at root level so check for this before displaying the homepage
          routes.MapRoute("UserProfile", "{url}",
              new { controller = "User", action = "Profile", url = "" }
          );
  
          routes.MapRoute("Home", "",
              new { controller = "Home", action = "Index", id = "" }
          );
      }
  </code></pre>
  
  <p>For the most part this works fine, however, my homepage is not being triggered! Essentially, when you browser to mydomain.com, it seems to trigger the User Profile route with an empty {url} parameter and so the homepage is never reached! Any ideas on how I can show the homepage?</p>