title: ASP.NET MVC Route with values before the controller and no trailing slash
body: <p>This is probably a simple question but I just can't get it to work.</p>
  
  <p>I've got this route specified in my RouteConfig</p>
  
  <pre><code>routes.MapRoute(
      name: "DefaultSiteRoute",
      url: "{accountid}/{hostname}/{controller}/{action}/{id}",
      defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, accountid = UrlParameter.Optional, hostname = UrlParameter.Optional  }
  );
  </code></pre>
  
  <p>And it works fine for a url like this</p>
  
  <blockquote>
    <p>/123456/www.test.com/</p>
  </blockquote>
  
  <p>or this</p>
  
  <blockquote>
    <p>/123456/www.test.com/Controller/Action</p>
  </blockquote>
  
  <p>but it can't cope with this</p>
  
  <blockquote>
    <p>/123456/www.test.com</p>
  </blockquote>
  
  <p>I get an IIS 404</p>
  
  <p>What is stranger is if I call <code>Url.Action</code> for that route with the default Controller and Action (ie Home/Index) it creates a url without a trailing slash, which it then doesn't recognise.  I really need it to work with and without the trailing slash.</p>