title: Route gets mapped to parameters of different route
body: <p>I’m trying to set up some routes for my ASP.NET MVC 5 project.</p>
  
  <ul>
  <li>I defined custom routes to get nice blog post permalinks – those
  seem to be working fine </li>
  <li>I added a XmlRpc Handler (similar to how it’s done
  in <a href="https://github.com/madskristensen/MiniBlog/blob/master/Website/app_code/handlers/MetaWeblogHandler.cs" rel="nofollow">Mads' Miniblog</a> and <a href="http://www.hanselman.com/blog/TheWeeklySourceCode55NotABlogALocalXMLRPCMetaWebLogEndpointThatLiesToWindowsLiveWriter.aspx" rel="nofollow">Scott’s post</a>)</li>
  </ul>
  
  <p>Now I have some strange behavior:</p>
  
  <ul>
  <li><code>/Home/About</code> is routed correctly </li>
  <li><strong><code>/Home/Index</code> gets routed to <code>/XmlRpc?action=Index&amp;controller=Blog</code></strong> </li>
  <li><code>/HOme/Index</code> works (yes I
  discovered that due to a typo) – I always thought routes are case
  insensitive?</li>
  <li>Using <code>Url.Action("Foo","Bar")</code> also creates <code>/XmlRpc?action=Foo&amp;controller=Bar</code></li>
  </ul>
  
  <p>This is my <code>RouteConfig</code> file:</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
  {
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
      routes.Add("XmlRpc", new Route("XmlRpc", new MetaWeblogRouteHandler()));
  
      routes.MapRoute("Post", "Post/{year}/{month}/{day}/{id}", new {controller = "Blog", action = "Post"}, new {year = @"\d{4,4}", month = @"\d{1,2}", day = @"\d{1,2}", id = @"(\w+-?)*"});
      routes.MapRoute("Posts on Day", "Post/{year}/{month}/{day}", new {controller = "Blog", action = "PostsOnDay"}, new {year = @"\d{4,4}", month = @"\d{1,2}", day = @"\d{1,2}"});
      routes.MapRoute("Posts in Month", "Post/{year}/{month}", new {controller = "Blog", action = "PostsInMonth"}, new {year = @"\d{4,4}", month = @"\d{1,2"});
      routes.MapRoute("Posts in Year", "Post/{year}", new {controller = "Blog", action = "PostsInYear"}, new {year = @"\d{4,4}"});
      routes.MapRoute("Post List Pages", "Page/{page}", new {controller = "Blog", action = "Index"}, new {page = @"\d{1,6}"});
      routes.MapRoute("Posts by Tag", "Tag/{tag}", new {controller = "Blog", action = "PostsByTag"}, new {id = @"(\w+-?)*"});
      routes.MapRoute("Posts by Category", "Category/{category}", new {controller = "Blog", action = "PostsByCategory"}, new {id = @"(\w+-?)*"});
  
      routes.MapRoute("Default", "{controller}/{action}/{id}", new {controller = "Blog", action = "Index", id = UrlParameter.Optional});            
  }
  </code></pre>
  
  <p>And that’s the definition of <code>MetaWeblogRouteHandler</code>:</p>
  
  <pre><code>public class MetaWeblogRouteHandler : IRouteHandler
  {
      public IHttpHandler GetHttpHandler(RequestContext requestContext)
      {
          return new MetaWeblog();
      }
  }
  </code></pre>
  
  <p>Basically I’d like to have the usual ASP.NET MVC routing behavior (/controller/action) + my defined custom routes for permalinks + XML-RPC handling via the XmlRpc handler only at /XmlRpc.</p>
  
  <p>Since the parameters are the same that are defined in the <code>Default</code> route I tried to remove the route, but without success.<br>
  Any ideas?</p>
  
  <p><strong>Update:</strong><br>
  When calling <code>/Home/Index</code> the <code>AppRelativeCurrentExecutionFilePath</code> is set to <code>"~/XmlRpc"</code> so the XmlRpc route is <em>legally</em> chosen. Something seems to be messing around with the request?</p>
  
  <p><strong>Update2:</strong> The problem fixed itself in every but one case: when starting IE via Visual Studio for Debug it still fails. In every other case it now works (yes I checked browser cache and even tried it on a different machine to be sure; IE started from VS = fail, all other combinations are fine). Anyway, since it will now work for the end user I'm satisfied for the moment ;)</p>