问题
I'm in the process of upgrading from classic ASP to MVC 4.0. MVC projects have a unique folder structure with modules, views, and controllers. Our classic ASP website is very well indexed in search engines, and uses all friendly URLs (some mapped to existing folders and removing page extensions, and others mapped for SEO and not to the folder containing the files), using Rewrite Rules in web.config. I need to maintain all the current URLs, but they all map into different folders than the MVC project will. I'd like the MVC project to remain in the folder structure defined in the default project, but also need to continue using the existing URLs.
What is the best way to maintain the current URLs of the site when moving to MVC? Is custom routing the only/best way to handle this?
回答1:
I gues there are four ways to do rewriting urls, no matter which one you use, you need to do some changes. For example you should change the way you read the url parameters.
I follow this tutorial http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
It helps alot
来源:https://stackoverflow.com/questions/16174425/upgrade-classic-asp-to-mvc-4-0