简体   繁体   English

HTTP 错误 500.19,错误代码 0x8007000d,同时尝试在 IIS 10 中使用“URL 重写”

[英]HTTP Error 500.19, error code 0x8007000d, while trying to use "URL Rewrite" in IIS 10

I tried using <rewrite> in web.config and received HTTP Error 500.19 error code 0x8007000d.我尝试在 web.config 中使用<rewrite>并收到HTTP 错误 500.19错误代码 0x8007000d。

Went to IIS Manager, found the "URL Rewrite" icon ( which means that the module is already installed and I don't have to install it again ), but clicking on it gave a generic "There was an error while performing this operation" error.转到IIS管理器,找到“URL重写”图标(这意味着该模块已经安装,我不必再次安装它),但单击它会给出一个通用的“执行此操作时出错”错误。

It didn't matter which website (or the server itself) I selected, clicking on the corresponding "URL Rewrite" icon still gave the same error message.我选择哪个网站(或服务器本身)并不重要,单击相应的“URL 重写”图标仍然会给出相同的错误消息。

At some point the error message started showing an additional detail: " The configuration section 'system.webServer/rewrite/globalRules' cannot be read because it is missing a section declaration ", I cannot recall changing anything, so I don't know what caused it to appear, so this is just an FYI.在某些时候,错误消息开始显示额外的细节:“无法读取配置部分 'system.webServer/rewrite/globalRules',因为它缺少部分声明”,我不记得更改任何内容,所以我不知道是什么导致它出现,所以这只是一个仅供参考。

I searched and found lots of other posts that contributed to the final solution, below are the steps that solved it for me:我搜索并发现了许多其他有助于最终解决方案的帖子,以下是为我解决问题的步骤:

On your server:在您的服务器上:

Check if the %SystemRoot%\\system32\\inetsrv\\rewrite.dll exists检查%SystemRoot%\\system32\\inetsrv\\rewrite.dll 是否存在

If yes, open this config file in Admin mode: %SystemRoot%\\System32\\inetsrv\\Config\\applicationHost.config (for 64 bit Windows make sure to use a 64 bit text editor, or you will get a 'file not found' error`) and check if you have the following 'rewrite' elements (Parent elements provided for structural reference only)如果是,请在管理员模式下打开此配置文件: %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" />

In my case every related part was missing in applicationHost.config, I had to add everything of the above.就我而言,applicationHost.config 中缺少所有相关部分,我必须添加上述所有内容。 Saved the file, restarted IIS (may not be necessary but I had a luxury of doing it), clicked on the "URL Rewrite" icon again and the error was gone.保存文件,重新启动 IIS(可能没有必要,但我很乐意这样做),再次单击“URL 重写”图标,错误消失了。 After that I modified my website's web.config with the new section and it worked as expected.之后,我用新部分修改了我网站的 web.config,它按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM