ASP.Net MVC | Mapping Static Files To MVC Controller

There are times, where we are working on projects that include migration of the websites with legacy technologies to the newer technologies. One of the requirement is to make sure, we some how map old URLs to new pages, so as to prevent unpleasant error pages to users who have bookmarked URLs from old website. However, other thing to keep in mind is that the old URLs indexed by Search Engines aren’t left completely broken.

ASP.Net MVC has feature where we can map the custom URLs to the MVC controller and actions. But this is limited to extension less URLs. Today we will see how to map URLs with the extensions (.html, .php, .asp, .aspx, etc.) or static files to MVC controller and actions.

Continue reading “ASP.Net MVC | Mapping Static Files To MVC Controller”