title: Asp.net routing to mask out physical folder in path
body: <p>To better organise my ASP.Net project I placed all my .aspx files in a folder called WebPages.</p>
  
  <p>I would like to find a way to mask out the 'WebPages' folder out from all my URLs. So for example, I do not want to use the following URLs:</p>
  
  <pre><code>http://localhost:7896/WebPages/index.aspx
  http://localhost:7896/WebPages/Admin/security.aspx
  </code></pre>
  
  <p>But instead, would like all my URLs to be as follows ('WebPages' is a physical folder that I use for structuring my work, but should not be visible to the outside world):</p>
  
  <pre><code>http://localhost:7896/index.aspx
  http://localhost:7896/admin/security.aspx
  </code></pre>
  
  <p>I was able to come up with a solution of my own by specifiying routing entries 'for every page' that I have in my project (and it works), but that is simply not maintainable going forward and I need another method.</p>
  
  <pre><code>public class Global : HttpApplication
  {
      protected void Application_Start(object sender, EventArgs e)
      {
          RegisterRoutes(RouteTable.Routes);
      }
  
      public static void RegisterRoutes(RouteCollection routes)
      {
          routes.MapPageRoute("", "index.aspx", "~/WebPages/index.aspx");
          routes.MapPageRoute("", "admin/security.aspx", "~/WebPages/Admin/security.aspx");
      }
  }
  </code></pre>
  
  <p>Perhaps what I am after is a class that catches all requests, and simply appends my 'WebPages' physical directory?</p>