2011-04-08 31 views
2

我更新了我的web.config支持URL重寫,但是當我用它我的Web服務器上它顯示了錯誤:Web.Config中的HttpModules內部服務器錯誤

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

我的web.config如下:

<configuration> 
    <configSections> 
    <section name="rewriter" 
      requirePermission="false"       
      type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/> 
    </configSections> 

    <rewriter> 
    <rewrite url="~/subjects/(.+).aspx" to="~/subject.aspx?ebook-subject=$1"/> 
    <rewrite url="~/books/(.+).aspx" to="~/book.aspx?ebook-name=$1"/> 
    <rewrite url="~/booklinks/(.+).aspx" to="~/booklink.aspx"/> 
    <rewrite url="~/subcategories/(.+).aspx" to="~/subcategory.aspx?ebook-subcategory=$1"/> 
    <rewrite url="~/categories/(.+).aspx" to="~/category.aspx?ebook-category=$1"/> 
    <rewrite url="~/explainsubjects/(.+).aspx" to="~/explainsubject.aspx?ebook-subject=$1"/> 

    <rewrite url="~/search/search.aspx" to="~/search.aspx"/> 
    <rewrite url="~/search/searchresults.aspx" to="~/searchresults.aspx"/> 
    </rewriter> 
    <system.web> 
    <httpModules> 
     <add name="UrlRewriter" 
      type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/> 
    </httpModules> 
    <compilation debug="true"/> 
    <authentication mode="Windows"/> 
    <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm"> 
    </customErrors> 
    <pages/> 
    </system.web> 
</configuration> 

我在做什麼錯?

+0

你的IIS版本? – 2011-04-08 17:34:56

+1

在我的網站中添加HttpModule時可能出現[「500 Internal Server Error」]重複(http://stackoverflow.com/questions/573325/500-internal-server-error-when-adding-httpmodule-in-my - 網站) – 2011-04-08 17:45:01

回答

2

This post解決我的問題。

+0

這就是爲什麼我要求IIS版本。我正在考慮同樣的問題,但在回答之前,我向你確認。 – 2011-04-08 17:44:17

+0

是的,但我沒有閱讀你的評論之前,我通過另一個問題在stackoverflow本身。不管怎麼說,多謝拉 ! – 2011-04-08 17:46:42

1

我認爲你已經在服務器本身上試過並檢查過事件日誌。

1

我認爲這個異常在配置文件的內容無效時拋出。

嘗試取出所有重定向並查看是否發生錯誤。

httpModule和configSections部分對我來說看起來不錯。

編輯:另外,作爲@mikeblake說,檢查日誌