在web.config中的IIS7"格式错误的XML"上的HTTP错误500.19

Chr*_*man 20 iis-7 cfwheels

我被迫从出厂默认设备重建我的机器.一切都应该是相同的,IIS版本(7.5),操作系统(Windows 7)和我的网站文件.但是,有些不同,因为在配置我的网站并在我的浏览器中提取本地网站后,我收到以下错误...

HTTP错误500.19 - 内部服务器错误无法访问请求的页面,因为页面的相关配置数据无效.错误代码0x8007000d

当我查找错误代码0x800700d时,它告诉我......

分析:出现此问题的原因是ApplicationHost.config文件或Web.config文件包含格式错误的XML元素.要解决此问题,请参阅解决方案1.

然后提供...的分辨率

建议的解决方案:从ApplicationHost.config文件或Web.config文件中删除格式错误的XML元素.

但是我没有看到格式错误的XML,当我完全删除web.config文件时,网站加载但URL重写不起作用(显然).此外,即使我从web.config文件中删除所有XML,将其留空,我也会收到同样的错误.它似乎存在web.config文件存在的问题.

作为参考,这是我的web.config的内容......

<?xml version="1.0" encoding="UTF-8"?>

<!-- this file can be deleted if you're not planning on using URL rewriting with IIS 7. -->
<!-- you can add your own files and folders that should be excluded from URL rewriting by adding them to the "pattern" below. -->
<!-- please read the online documentation on http://cfwheels.org for more information about URL rewriting. -->

<!-- SET ENABLED TO TRUE BELOW TO TURN ON THE URL REWRITING RULES -->

<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="ColdFusion on Wheels URL Rewriting" enabled="true">
                <match url="^(.*)$" ignoreCase="true" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{SCRIPT_NAME}" negate="true" pattern="^/(flex2gateway|jrunscripts|cfide|cfformgateway|railo-context|files|images|javascripts|miscellaneous|stylesheets|robots.txt|sitemap.xml|rewrite.cfm)($|/.*$)" />
                </conditions>
                <action type="Rewrite" url="/rewrite.cfm/{R:1}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

有人对如何解决这个问题有任何想法?

Joh*_*hnW 27

你还记得重新安装重写模块吗?默认情况下,它不包含在IIS 7.5中.

除此之外,这是一个类似的问题 - 我认为关于畸形的部分是一个红鲱鱼.

  • 谢谢JohnW!我终于解决了这个问题.我确实安装了重写模块,但是在阅读了你发送给我的链接以及发布的所有相关链接后,我认为这可能是两件事之一... 1)AJAX未正确安装2)重写模块安装不正确.所以,我重新安装了.NET然后重新安装了重写模块,它现在工作正常.也许我上次在.NET之前安装了重写模块......不确定. (3认同)