title: Wrong route selected in ASP.NET MVC 3
body: <p>Could please someone shed some light into this issue, it drives me crazy!</p>
  
  <p>The routes:</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
  {
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
      routes.MapRoute(
       "DefaultOrderingRoute", // Route name
       "{controller}/{action}/{id}/{slug}", // URL with parameters
       new { controller = "Order", slug = UrlParameter.Optional }, // Parameter defaults
       new { controller = "^Order$" }
      );
  
      routes.MapRoute(
        "DefaultImageRoute", // Route name
        "{controller}/{action}/{id}", // URL with parameters
        new { controller = "Image", }, // Parameter defaults
        new { controller = "^Image$" }
      );
  
      routes.MapRoute(
        "FooterRoute", //route for invoking actions for the Footer
        "{controller}/{action}", // URL with parameters
        new { controller = "Footer", }, // Parameter defaults
        new { controller = "^Footer$" }
      );
  
      routes.MapRoute(
         "DefaultDealRoute", // Route name
         "{city}/{category}/{id}/{slug}", // URL with parameters
         new { category = Deals.Globals.Global.CATEGORY_ALL_NAME, controller = "Deal", action = "Details", slug = UrlParameter.Optional }, // Parameter defaults
         new { controller = "^Deal$", id = @"\d+" }
      );
  
      routes.MapRoute(
          "DealRouteForCategory", // Route name
          "{city}/{category}", // URL with parameters
          new { city = "", category = Deals.Globals.Global.CATEGORY_ALL_NAME, controller = "Deal", action = "Details" }, // Parameter defaults   
          new { controller = "^Deal$" }
      );
  }
  </code></pre>
  
  <p>I have add a reference to routedebugger to see what is going on under the hood.
  So for the selected URL:</p>
  
  <p><a href="http://my.SERVER.IP/VirtualDirectoryName/Order/PayPalNotify/9/blabla" rel="nofollow">http://my.SERVER.IP/VirtualDirectoryName/Order/PayPalNotify/9/blabla</a></p>
  
  <p>the URL debugger shows the following:</p>
  
  <p>AppRelativeCurrentExecutionFilePath: ~/Order/PayPalNotify/9/adfaf   (exactly what i have expected)!!!</p>
  
  <p>The debugger also shows that routes DefaultOrderingRoute and DefaultDealRoute are matched (this i didn't expect! since i have constraints on the routes!!).</p>
  
  <p>It also shows that the matched route is:</p>
  
  <p>Matched Route: {controller}/{action}/{id}/{slug}</p>
  
  <p>with route data:</p>
  
  <pre><code>controller:  Deal
  action:      Details
  id:          9
  slug:        adfaf
  city:        Athens
  category:    All
  </code></pre>
  
  <p>How is this possible?? What am i doing wrong?</p>
  
  <p>PS. I've noticed that by <strong>reissuing</strong> the URL the correct route gets executed!!! </p>