mvc 標准的寫法 通常是(http://localhost:8149/Home/Index) 路由配置如下:

有時候需求 如 http://localhost:8149/Home/Index 改為http://localhost:8149/index.html 讓其看起來更加像一個靜態網站
//配置首頁 偽靜態 路由
routes.MapRoute("pc_index", "index.html", new { controller = "Home", action = "Index" });
然而 
解決方式一(不建議)修改 Web.config 文件
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" >
</modules>
</system.webServer>
這種方式強烈不建議:
1、這些問題的形式是使所有注冊的HTTP模塊在每個請求上運行,而不僅僅是托管請求(例如.html)。 這意味着模塊將永遠運行.jpg .gif .css .aspx等
2、浪費資源
3、並具有可能導致錯誤的全局效應
更好的解決方案(方式二)
<system.webServer>
<modules >
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
</system.webServer>
更好的解決方案(方式三)
<system.webServer>
<handlers>
<add name="htmlHandler" verb="GET,HEAD" path="*.html" type="System.Web.StaticFileHandler"/>
</handlers>
</system.webServer>
