MVC4 为什么不能作为文件路由.html?



我使用visual studio 2012与MVC4。我想要一些网页看起来像。html后缀。所以我在RouteConfig上添加了这段代码:

routes.MapRoute(
   name: "Static",
   url: "{controller}/{action}/{id}.html",
   defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

但问题是我无法访问它,页面总是返回404,并显示消息:

资源未找到或未删除.......

是否有任何方法可以让它路由为html页面?由于

禁用.html扩展的处理程序。

最新更新