码迷,mamicode.com
首页 > Web开发 > 详细

mvc url 伪静态

时间:2015-11-03 17:40:54      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:

WebConfig配置

 1 <system.webServer>
 2     <validation validateIntegratedModeConfiguration="false" />
 3     <handlers>
 4       <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
 5       <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
 6       <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
 7       <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
 8       <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
 9       <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
10 
11       <!--伪静态 开始-->
12       <add name="(HTML) ExtensionlessUrlHandler-ISAPI-4.0_32bit"
13            path="*.html"
14            verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
15            modules="IsapiModule"
16            scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
17            preCondition="classicMode,runtimeVersionv4.0,bitness32"
18            responseBufferLimit="0" />
19       <add name="(HTML) ExtensionlessUrlHandler-ISAPI-4.0_64bit"
20            path="*.html"
21            verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
22            modules="IsapiModule"
23            scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll"
24            preCondition="classicMode,runtimeVersionv4.0,bitness64"
25            responseBufferLimit="0" />
26       <add name="(HTML) ExtensionlessUrlHandler-Integrated-4.0"
27            path="*.html"
28            verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
29            type="System.Web.Handlers.TransferRequestHandler"
30            preCondition="integratedMode,runtimeVersionv4.0" />
31       <!--伪静态 结束-->
32     </handlers>
33   </system.webServer>

路由设置

 1     public class RouteConfig
 2     {
 3         public static void RegisterRoutes(RouteCollection routes)
 4         {
 5             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
 6 
 7             routes.MapRoute(
 8                 name: "Default",
 9                 url: "{controller}/{action}/{id}.html",
10                 defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
11                 );
12         }
13     }

 

参考自: http://m.blog.csdn.net/blog/shandian84/40903663

mvc url 伪静态

标签:

原文地址:http://www.cnblogs.com/DKnight/p/4933552.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!