title: How to customize MVC url path
body: <p>I am trying to create a clean URL path to an MVC controller and I need a little assistance.</p>
  
  <p>Example desired path: <code>http://www.linkedin.com/in/alumcloud</code>. This path is from LinkedIn and notice how it has the <code>/in/alumcloud</code>.</p>
  
  <p>I would like for mine to read: <code>http://www.alumcloud.com/alumcloud/somecompanyname</code></p>
  
  <p><strong>How would I do this with an MVC controller?</strong></p>
  
  <p>Below is the only code in my MVC controller, becuase this controller is only needed to respond to <code>GET HTTP</code> methods.</p>
  
  <pre><code>public class AlumCloudController : AlumCloudMvcControllerBase
  {
      // GET: /AlumCloud/Details/5
      public ActionResult Details(string companyName)
      {
          return View();
      }
  }
  </code></pre>
  
  <p><strong>--Here is my RouteConfig</strong></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 }
          );
      }
  }
  </code></pre>
  
  <p><strong>-----------------------------------2nd Attempt------------------------------------</strong></p>
  
  <p><strong>--Route Code 2</strong></p>
  
  <pre><code>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: "Public",
                  url: "ac/{companyName}",
                  defaults: new { controller = "AlumCloudController", action = "UserProfile" }
              );
   }
  </code></pre>
  
  <p><strong>--Controller Code 2</strong></p>
  
  <pre><code>public class AlumCloudController : AlumCloudMvcControllerBase
  {
      // GET: /AlumCloud/Details/5
      public ActionResult UserProfile(string companyName)
      {
          return View();
      }
  }
  </code></pre>
  
  <p><strong>--The URL</strong></p>
  
  <pre><code>'/ac/' + options.person.CompanyName 
  </code></pre>
  
  <p><strong>--Snap shot of 404 error</strong></p>
  
  <p><img src="https://i.stack.imgur.com/Z8rVp.png" alt="404 mvc error"></p>