asp.net - Web.Config httpModules 内部服务器错误

标签 asp.net iis web-config

我更新了 web.config 以支持 URL 重写,但是当我在网络服务器上使用它时,它显示错误:

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>

我做错了什么?

最佳答案

This post解决了我的问题。

关于asp.net - Web.Config httpModules 内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5598014/

相关文章:

c# - MVC 4 - JSON ajax 操作结果的 GZIP 压缩

visual-studio - Web Deploy 3.0 发布时出现令人恼火的 401 错误

c# - Azure Web应用程序负载平衡超时问题,获取 HTTP 状态 500 和子状态 121

c# - 使用 Blazor 在 ASP.NET CORE 中更新数据库后如何刷新网页

c# - 如何更新Web.config以通过C#通过电子邮件发送错误?

asp.net - 在Web部署之外应用Web.Config转换

java - 如何为 Java Web 服务创建和使用配置文件?

html - V 对齐顶部在 TD 内不起作用

带有 IIS 7 的 ASP.NET - 对所有 QueryString 值进行 URLEncoding 是否有合法的安全原因?

c# - Asp.net 日历如何