title: How to create an MVC route to intercept classic ASP URLs?
body: <p><strong>My question up front</strong></p>
  
  <p>How do I construct a route so that MVC will intercept the classic ASP URL and instead execute an MVC action?</p>
  
  <p>I am migrating a legacy classic ASP application to MVC, and need to have MVC intercept a couple of the legacy ASP URLs because they are major endpoints for external access to the application. But I can't seem to figure out how to do it correctly.</p>
  
  <p>I checked a few other questions and didn't quite find what I'm looking for, but maybe my search-fu is poor today. <a href="https://stackoverflow.com/questions/11148668/how-to-map-a-classic-asp-request-to-an-mvc-controller-and-action" title="This one">This one</a> is specific to areas but looks similar to mine which still doesn't work, and <a href="https://stackoverflow.com/questions/29143839/how-to-route-url-from-classic-asp-to-mvc-application">this one</a> is a possible workaround but I'd really rather handle this completely within MVC and eliminate the legacy file completely.</p>
  
  <p><strong>What I want to do</strong></p>
  
  <p>Given:  /foo/bar.asp</p>
  
  <p>Map to:  /InboundLinks/HandleBar</p>
  
  <p>(one URL will be a GET request, but the other will be a POST with some sensitive data, so I need them to be intercepted and the POST data still available to MVC, not sure if a 301 redirect will do that or not)</p>
  
  <p><strong>What I DON'T want to do</strong></p>
  
  <p>I do NOT want to run the classic ASP pages at all. (I'm willing to have it solely do a 301 redirect to the MVC URL if that is the only workaround, but that's it) I want the URLs to be intercepted and handled by MVC. I say this because a few questions I found here and elsewhere seemed to generate some confusion on that point.</p>
  
  <p><strong>What I've already tried</strong></p>
  
  <pre><code>routes.MapRoute(
      name: "LegacyBarUrl",
      url:  "foo/bar.asp",
      defaults: new { controller = "InboundLinks", action = "HandleBar" }
  );
  </code></pre>
  
  <p>But this returns a <strong>404 Not Found</strong> error.</p>
  
  <p><strong>Environment</strong></p>
  
  <p>Visual Studio 2013 running in local dev mode on Windows 7. Deployment will be to IIS 7 on a locked down server I don't control, so installing HTTP modules on the server isn't an option unfortunately. The domain will remain the same.</p>
  
  <p>Many thanks in advance for any help/guidance/etc.</p>