title: Why Is the Path Info Routing Not Working in ASP.NET MVC Example?
body: <p>I am reading the book <em>C# 6.0 and the .NET 4.6 Framework</em> and I was looking at the customized routing example <code>routes.MapRoute("Contact", "Contact/{*pathinfo}", new { controller = "Home", action = "Contact" });</code>. The authors says that this should allow me to put in the url <code>http://localhost:64173/Home/Contact/Foo/Bar</code> and still be directed to the Contact page, because of the addition of <code>*pathinfo</code>. However, it is simply giving me a 404 Not Found. Specifically the authors state: </p>
  
  <blockquote>
    <p>...adding {*pathinfo} to the pattern... allows any number of additional
    URL parameters... Now when you enter the URL <code>http://localhost:64173/Home/Contact/Foo/Bar</code> it still shows the Contact page.</p>
  </blockquote>
  
  <p>But I still get the 404 Error. I noted that <code>http://localhost:64173/Home/Contact/Foo</code> as well as <code>http://localhost:64173/Contact/Foo/parm1/parm2/parm3</code>. All of these redirect back to the Contact page. Here is what the full routing looks like: </p>
  
  <pre><code>public class RouteConfig
      {
          public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
              routes.MapRoute("Contact", "Contact/{*pathinfo}", new { controller = "Home", action = "Contact" });
              routes.MapRoute("About", "About/{*pathinfo}", new { controller = "Home", action = "About" });
              routes.MapRoute(
                  name: "Default",
                  url: "{controller}/{action}/{id}",
                  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
              );
          }
      }
  </code></pre>
  
  <p>Thanks, I know this probably obvious, but I can't tell if the author made a mistake or if I'm missing something in my routes. </p>
  
  <p>Note1: I also tried *pathInfo (with the "I" capitalized). This did not work either. </p>
  
  <p>Note2: Navigating to <code>http://localhost:64173/Home/Contact/Foo</code>works just fine.</p>