aspx后缀映射成html
2016-03-02 10:15
796 查看
1.网站的配置文件添加如下代码:
配置文件
2.IIS里面进入》处理程序映射模块》添加脚本映射》
请求路径:*.html
可执行文件:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
名称:htmlx64
请求限制:不勾选
然后确认就OK
3.代码内部的跳转只要是跳转到*.aspx的都换成*.html (url地址)
<configuration> <configSections> <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" /> </configSections> <RewriterConfig> <Rules> <RewriterRule> <LookFor>/Index.html</LookFor> <SendTo>/Index.aspx</SendTo> </RewriterRule> <RewriterRule> <LookFor>/Enterprise/Login.html</LookFor> <SendTo>/Enterprise/Login.aspx</SendTo> </RewriterRule> <RewriterRule> <LookFor>/Government/Login.html</LookFor> <SendTo>/Government/Login.aspx</SendTo> </RewriterRule> <RewriterRule> <LookFor>/Government/Main.html</LookFor> <SendTo>/Government/Main.aspx</SendTo> </RewriterRule> <RewriterRule> <LookFor>/Enterprise/Main.html</LookFor> <SendTo>/Enterprise/Main.aspx</SendTo> </RewriterRule> </Rules> </RewriterConfig> <system.web> <httpHandlers> <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> </httpHandlers> <httpModules> <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/> </httpModules> </system.web> </configuration>
配置文件
2.IIS里面进入》处理程序映射模块》添加脚本映射》
请求路径:*.html
可执行文件:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
名称:htmlx64
请求限制:不勾选
然后确认就OK
3.代码内部的跳转只要是跳转到*.aspx的都换成*.html (url地址)
相关文章推荐
- ASP.NET Core – 2300% More Requests Served Per Second
- asp.net+js实现批量编码与解码的方法
- ASP.NET Mvc开发之删除修改数据
- 7天 搞定 ASP.NET MVC - 第2天
- 谈谈IIS与ASP.NET管道
- asp.net页面之间的跳转
- Asp.net MVC中Html.Partial, RenderPartial, Action,RenderAction 区别和用法【转发】
- asp.net连接数据库报错
- ASP.NET MVC学前篇之Ninject的初步了解
- raspberry-pi之DSI
- 在ASP.NET Core 1.0中如何发送邮件
- Raspberry pi raspbain source mirror
- ASP.NET MVC 中实现View与Controller分离
- 实战:把ASP.NET MVC中的Views下面的视图放到Views文件夹外
- 轻量级asp.net ajax解决方案详解
- classic asp中使用ADODB.Command防止sql injection
- 几种判断asp.net中session过期方法的比较
- ASP.NET MVC URL重写与优化(1)-使用Global路由表定制URL
- 新手留言薄asp.net MVC 学习(适合新手学习)
- ASP.NET(C#)——唯一订单号