【问题标题】:HTTP Error 500.19, error code 0x8007000d, while trying to use "URL Rewrite" in IIS 10HTTP 错误 500.19,错误代码 0x8007000d,同时尝试在 IIS 10 中使用“URL 重写”
【发布时间】:2020-02-11 20:31:41
【问题描述】:

我尝试在 web.config 中使用 <rewrite> 并收到 HTTP 错误 500.19 错误代码 0x8007000d。

进入 IIS 管理器,找到“URL Rewrite”图标(这意味着该模块已经安装,我不必再次安装它),但点击它给出了一个通用的“执行此操作时出错”错误。

无论我选择哪个网站(或服务器本身),单击相应的“URL 重写”图标仍然会给出相同的错误消息。

在某些时候,错误消息开始显示其他详细信息:“无法读取配置部分 'system.webServer/rewrite/globalRules',因为它缺少部分声明”,我不记得了改变任何东西,所以我不知道是什么导致它出现,所以这只是一个仅供参考。

我搜索并发现了许多有助于最终解决方案的其他帖子,以下是为我解决它的步骤:

【问题讨论】:

    标签: url-rewriting samesite applicationhost


    【解决方案1】:

    在您的服务器上:

    检查%SystemRoot%\system32\inetsrv\rewrite.dll是否存在

    如果是,请在管理员模式下打开此配置文件: %SystemRoot%\System32\inetsrv\Config\applicationHost.config (对于 64 位 Windows,请确保使用 64 位文本编辑器,否则您将收到“找不到文件”错误)并检查您是否有以下“重写”元素(父元素仅供结构参考)

    <sectionGroup name="system.webServer">
        <sectionGroup name="rewrite">
        <section name="rules" overrideModeDefault="Allow" />
        <section name="globalRules" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
        <section name="outboundRules" overrideModeDefault="Allow" />
        <section name="providers" overrideModeDefault="Allow" />
        <section name="rewriteMaps" overrideModeDefault="Allow" />
        <section name="allowedServerVariables" overrideModeDefault="Deny" />
    </sectionGroup>
    
    
    
    <globalModules>
        <add name="Rewrite" image="%SystemRoot%\System32\inetsrv\rewrite.dll" preCondition="bitness64" />
    
    
    
    <location path="" overrideMode="Allow">
        <system.webServer>
            <modules>
                <add name="Rewrite" preCondition="bitness64" />
    

    在我的情况下,applicationHost.config 中缺少每个相关部分,我必须添加上述所有内容。保存文件,重新启动 IIS(可能没有必要,但我很乐意这样做),再次单击“URL Rewrite”图标,错误就消失了。之后,我用新部分修改了我网站的 web.config,它按预期工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-19
      • 1970-01-01
      • 1970-01-01
      • 2015-05-16
      • 1970-01-01
      • 2021-05-09
      相关资源
      最近更新 更多