I have a web server that has existing pages in it that are created with basic static HTML. I want to leave them alone, but augment the site with some ASP.NET MVC pages. I want these pages to be reachable via the MVC URL routing mechanism. But, ideally, I want to preserve the old static pages URLs without having to bring all those static pages into the MVC app. What's the best way to accomplish this?
+2
A:
Static files such as .html pages that exist on disc will be directly served by the web server. If you are hosting your application in II7 integrated mode you could try adding the following route:
routes.IgnoreRoute("{file}.html");
By default routing is not applied when a physical file exists which could be turned off by using routes.RouteExistingFiles = true;
.
Darin Dimitrov
2010-07-18 14:13:34
Unfortunately this is IIS 6, and I don't have direct access to the web server to add a wildcard route as per the MS documentation. That makes this impossible probably.
jkohlhepp
2010-07-18 14:40:58
I think that there will be no problem with static files in II6. Just try placing them in some subfolder of the application and normally they should be served directly by IIS.
Darin Dimitrov
2010-07-18 14:42:35