title: ASP.NET MVC4 Custom routing
body: <p>I want to create simple blog engine. For fancy and clean url I'd like to use routing mechanism implemented in MVC4. </p>
  
  <p>I added to <em>RouteConfig.cs</em> this lines:</p>
  
  <pre><code>public class RouteConfig
  {
      public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
          );
  
          routes.MapRoute(
              name: "ArticleList",
              url: "Articles/{category}/{page}",
              defaults: new
                            {
                                controller = "Articles",
                                category = UrlParameter.Optional,
                                page = 1
                            });
      }
  }
  </code></pre>
  
  <p>And if I write in web browser url:</p>
  
  <pre><code>http://localhost:6666/Articles/SomeCategory/3
  </code></pre>
  
  <p>I want to move to this controller:</p>
  
  <pre><code>public class ArticlesController : ControllerBase&lt;IHomeService&gt;
  {
      public ActionResult Index(string category, int page = 0)
      {
          return View("~/Views/Article/Articles.cshtml");
      }
  
  }
  </code></pre>
  
  <p>with parameters category = "SomeCategory" and page = 1.</p>
  
  <p>All I recieve is
  Server Error in '/' Application.
  The resource cannot be found.</p>
  
  <p>What is wrong?</p>