2013-01-03 391 views
11

我不得不從出廠默認值重建我的機器。一切都應該是一樣的,IIS版本(7.5),操作系統(Windows 7)和我的網站文件。但是,一些事情,因爲配置我的網站,並在拉我的瀏覽器,我得到以下錯誤的本地網站上去後是不同的...IIS7上的HTTP錯誤500.19 web.config中的「格式錯誤的XML」

HTTP錯誤500.19 - 內部服務器錯誤請求的頁面無法訪問,因爲該頁面的相關配置數據無效。錯誤代碼0x8007000d

當我look up error code 0x800700d它告訴我...

分析:出現此問題是因爲ApplicationHost.config文件或Web.config文件包含格式不正確的XML元素。要解決此問題,請參閱解決方案1.

然後提供的分辨率...

建議的解決方案:從ApplicationHost.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> 

任何有關於如何解決此問題的任何想法?

+0

我們有兩個不喜歡'encoding =「UTF8」'的服務器。另一臺服務器沒有任何問題。仍然不知道爲什麼。 – Fried

回答

16

您是否記得重新安裝rewrite module?它默認不包含在IIS 7.5中。

除此之外,這裏是similar question - 我認爲有關畸形的部分是紅鯡魚。

+3

謝謝JohnW!我終於解決了這個問題。我確實已經安裝了重寫模塊,但在閱讀完您發送的鏈接以及發佈的所有相關鏈接後,我認爲它可能是以下兩種情況之一:1)AJAX未正確安裝2)重寫模塊沒有正確安裝。所以,我重新安裝了.NET,然後重新安裝了重寫模塊,現在工作正常。也許我上次安裝了.NET之前的重寫模塊......不確定。 –

+0

謝謝!有效。 –

-1

我和你在尋找XML時的情況一樣。 我找到了解決方案。在web.config文件中有 ,在文件的頂部有一個xml部分。刪除下面的內容,這解決了我的問題,以後可以在網站上打開。

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

-2

只是創建新的網站集並更換新的web.config中損壞的一個,對我來說工作思路

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> 
0

這個問題也發生在我身上...... 試試這個錯誤代碼0x8007000d。

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

從您的web.config文件中刪除此行。

這是一個格式錯誤的XML元素。

刪除或評論它。

相關問題