环境:VS2013+MVC5+IIS EXPRESS
问题:如果从Asp.net Web迁移到MVC,可能会遇到需要使原来的链接(如http://localhost:12345/old/library.html)可以继续访问,并且把原来的链接定位到新的Action的情况,而默认情况下,MVC对于html后缀是不经过路由的,直接给你一个404错误(未找到)
解决:在web.config里添加
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
最佳:
多谢白云随风的方案:
</handlers>