asp.net网站使用URLRewriter后在iis7.0中的配置

首先,关于IIS中的配置,可以参见http://jingyan.baidu.com/article/67508eb4ff92c69cca1ce49a.html。讲的很详细,

至于URLRewriter的配置在这也不多说,因为网上已经有很多资料。

我主要是想描述一下我遇到的问题以及我搜到的解决方案,以便以后查阅。

我遇到的问题就是,配置好以后,你可能会发现访问HTML页面的时候会出现问题,提示不能访问HTML页面,那么可以在webconfig文件中加入以下节点

在system.web节点里加入

<compilation debug="true">
<buildProviders>
<add extension=".html" type="System.Web.Compilation.PageBuildProvider"/>
</buildProviders>
</compilation>

然后在加入

<httpHandlers>
<add path="*.html" verb="*" type="System.Web.UI.PageHandlerFactory" validate="true"/>
</httpHandlers>

在访问HTML页面就没有问题了。

原文地址:https://www.cnblogs.com/sulei4471/p/3282138.html