通过web.config做html映射aspx
来源:互联网 发布:单片机论坛网 编辑:程序博客网 时间:2024/06/09 19:49
在将dtcms发布之后,绑定到iis后,发现html页面都不能访问,在dtcms论坛里找到解决方法:
http://bbs.dtcms.net/forum.php?mod=viewthread&tid=18&extra=
一般在web.config中添加这个映射配置.是虚拟主机的用户才需要用到
注意:以下代码已通过测试,在IIS6.0版本以上可以使用
.NET 2.0的配置代码如下
<!--2.0版本--><system.webServer> <handlers> <add name="html-ISAPI-2.0" path="*.html" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptprocessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" precondition="classicMode,runtimeVersionv2.0,bitness32" responsebufferlimit="0" /> </handlers></system.webServer>..NET 4.0的配置代码如下<!--4.0版本--><system.webServer> <handlers> <add name="html-4.0" path="*.html" verb="*" modules="IsapiModule" scriptprocessor="%SystemRoot%\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll" resourcetype="unspecified" precondition="classicmode,runtimeversionv4.0,bitness32" /> </handlers></system.webServer>
对不起大家忘写一个最重要的配置说明了.现在补充
<!--将如下代码copy到handlers节点上前--><modules runallmanagedmodulesforallrequests="true"> <add name="HttpModule_rewriter" type="DTcms.Web.UI.HttpModule" /></modules>
我测试不加modules节点,也可以使用。
在Web.config中添加htm伪静态映射,htm伪静态并没有在iis中的处理程序映射进行相关设置,却可以实现伪静态。
因为在iis中的设置也是做这个工作,即把*.html映射到了aspnet_isapi.dll引擎解析。
<system.webServer><handlers> <add name="htmlrequest" path="*.html" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" /></handlers></system.webServer>
0 0
- 通过web.config做html映射aspx
- IIS7 下通过web.config来控制html文件的访问
- 使用web.config在.aspx导入命名空间
- C# aspx获取web.config中的key值
- 在Web.config文件中映射控件
- UrlRewrite、地址映射技术(jsp,asp,aspx,php转html)
- 通过web.config设置数据库连接串
- 如何通过代码修改web.config文件?
- 通过配置web.config发电子邮件详解
- 通过web.config配置数据库连接池
- 如何通过代码修改web.config文件
- 通过web.config调用connection string
- 通过编程读写Web.config配置节
- 通过编程读写Web.config配置节
- 通过configSource提高web.config配置灵活性
- 通过configSource提高web.config配置灵活性
- 如何通过代码修改web.config文件
- 通过configSource提高web.config配置灵活性
- ASP.NET如何实现服务器端身份验证和客户端状态管理?(Session机制和Cookie)
- 全排列算法的非递归实现
- 50个C/C++源码网站
- 学习c++的50条忠告
- poj2299 Ultra-QuickSort
- 通过web.config做html映射aspx
- Linux NFS服务器的安装与配置
- Android 教程:Play 商店常见错误代码及解决方法http://www.geekfan.net/9148/
- 海思HI35XX之----视频处理单元各通道间的关系
- cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- C语言基础--数据
- PyQt4 精彩实例分析* 实例7 表格的使用
- 线性表分析及Java实现
- 秋天来了,风伯伯把夏天的炎热吹走了