Upgrade classic ASP to MVC 4.0

时间秒杀一切 提交于 2019-12-12 00:06:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!