title: MVC Route Hide Controller in URL
body: <p>I want to make a route where the controller name is not displayed in the URL.</p>
  
  <p>I started with this route:</p>
  
  <pre><code>routes.MapRoute(
      name: "ViewTag",
      url: "tag/tagged/{tag}",
      defaults: new { controller = "Tag", action = "Tagged" }
  );
  </code></pre>
  
  <p>And controller method:</p>
  
  <pre><code>public class TagController : Controller
  {
      public ActionResult Tagged(string tag)
      {
  </code></pre>
  
  <p>Which works but generates URL: <code>tag/tagged/money</code></p>
  
  <p>I wanted to use the URL: <code>tagged/money</code></p>
  
  <p>I changed the route to remove the controller name:</p>
  
  <pre><code>routes.MapRoute(
      name: "ViewTag",
      url: "tagged/{tag}",
      defaults: new { controller = "Tag", action = "Tagged" }
  );
  </code></pre>
  
  <p>Which does route correctly when I manually type in the URL: <code>tagged/money</code> but, it doesn't generate the correct routes.</p>
  
  <pre><code>@Html.ActionLink(tag.Text, "tagged", new { @tag = tag.Text })
  </code></pre>
  
  <p>or</p>
  
  <pre><code>@Html.ActionLink(tag.Text, "tagged", "tag", new { @tag = tag.Text }, null)
  </code></pre>
  
  <p>Both generate the original and wrong URL: <code>tag/tagged/{tag}</code></p>
  
  <p>I thought the route config was used to both parse incoming URL's and generate URL's?</p>