当我运行我的.aspx页面时,我得到了以下错误。
错误Code0x8007000d无法读取配置节'rewrite‘,因为它缺少节声明
我有一个简单的v.aspx页面,其中包含以下代码:
Response.Write(请求(“q”))
我的主机服务器安装了IIS 7,并启用了URL重写功能(这是他们所声称的)
我的web.config文件在下面有以下几行:
注意:节点下面有蓝色的曲线条。
<rewrite>
<rules>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="v.aspx?q={R:1}" />
</rule>
</rules>
</rewrite>
我已经搜索了stackoverflow,但没有找到解决方案。
也许有人找到了解决方案。
提亚
发布于 2009-11-16 05:55:59
确保您的<rewrite>
包含在<system.webServer></system.webServer>
部分中。
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="v.aspx?q={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
发布于 2012-06-20 21:34:50
安装URL重写模块http://www.iis.net/download/URLRewrite,并对其进行排序。它解决了我的问题
发布于 2012-04-17 22:39:30
IIS7支持system.webServer中的重写部分,但IIS6不支持。该错误可能是由于将此站点部署到仅运行IIS6的服务器而导致的。
https://stackoverflow.com/questions/1738735
复制相似问题