title: ASP.NET MVC 5 Routing problems
body: <p>I have the following route mappings:</p>
  
  <pre><code>        routes.MapRoute(
              name: "Post-Details",
              url: "{catSlug}/{postSlug}",
              defaults: new { controller = "BlogPost", action = "Details", catSlug = UrlParameter.Optional, postSlug = UrlParameter.Optional }
          );
  
          routes.MapRoute(
              name: "Default",
              url: "{action}",
              defaults: new { controller = "Home", action = "Index" }
          );
  </code></pre>
  
  <p>I cannot understand why Post-Details is used when I try to load localhost:port/Index.</p>
  
  <p>When I change their places (Post-Details goes after Default) everything works great.</p>
  
  <p>And still my other route:</p>
  
  <pre><code>        routes.MapRoute(
              name: "Category",
              url: "{catSlug}",
              defaults: new { controller = "Category", action = "Index", catSlug = UrlParameter.Optional }
          );
  </code></pre>
  
  <p>cannot be used anywhere. If I use it after the Default route I always get this error:</p>
  
  <pre><code>Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 
  </code></pre>
  
  <p>If I try to use it before my Default route I get the same result - on trying to load localhost:port/Index, then Category route is used...</p>
  
  <p>Any help will be appreciated.</p>
  
  <p>Thanks in advance!</p>
  
  <h2>Edit 1:</h2>
  
  <p>I am not sure but I think that maybe Post-Details and Category routes interfere with each other... And when I comment out Category route, the link which should be using this route becomes unavailable.</p>