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

时间:2013-01-03 01:49:11

标签: iis-7 cfwheels

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

  

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

当我look up error code 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>

任何人对如何解决此问题都有任何想法?

6 个答案:

答案 0 :(得分:22)

您还记得重新安装rewrite module吗?默认情况下,它不包含在IIS 7.5中。

除此之外,这里有similar question - 我认为关于畸形的部分是红鲱鱼。

答案 1 :(得分:1)

经过这么多的痛苦,我可以解决这个错误。我的实际原因是我在配置中使用了一些url重写。删除后错误消失了。以下是我从web.config中删除的代码。

  <serverRuntime frequentHitThreshold="1" frequentHitTimePeriod="10:00:00"/>
<rewrite>
  <rules>
    <rule name="HTTP to HTTPS redirect" stopProcessing="true">
      <match url="(.*)"/>
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true"/>
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="https://wikigurus.com/{R:1}"/>
    </rule>
  </rules>
</rewrite>

答案 2 :(得分:-1)

我和你寻找XML的情况相同。 我找到了解决方案。 在web.config文件中,在文件的顶部有一个xml部分。删除下面的内容,这解决了我的问题,以后可以在网站上打开。

<system.net>
<defaultProxy>
  <proxy autoDetect="true" />
</defaultProxy>

答案 3 :(得分:-1)

这个问题也发生在我身上...... 尝试使用错误代码0x8007000d。

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

从web.config文件中删除此行。

这是格式错误的XML元素。

删除或评论。

答案 4 :(得分:-2)

只需创建新的网站集并将新的web.config替换为损坏的网站,为我工作

答案 5 :(得分:-2)

请安装两个exe文件“dotnet-sdk-3.1.102-win-x64”和“dotnet-hosting-3.1.1-win”。

相关问题