I am trying to create a legacy route to redirect old asp links to the new urls.
My route is as follows and it's the first route in the list:
routes.MapRoute(
"", // Route name
"{*path}", // URL with parameters
new { controller = "Legacey", action = "Legacey" },
new { path = @".*\.asp.*" });// Parameter defaults
The problem I have is IIS intercepts these and 404s them before they hit my route. I guess there's a setting in the web.config to tell IIS to stop doing this but I can't find it.
You could accomplish this through URL rewriting, as explained in this post
Just add something like this to your web.Config (replace Legacey/Legacey with the redirect URL for the asp pages):
I haven't tested this, it's just what I've understood from that post.