我已经安装了URL重写模块7.2.1993,现在正尝试在此处复制示例示例:https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-20-configuration-reference#setting-response-headers,即:
<outboundRules>
<!-- This rule changes the domain in the HTTP location header for redirection responses -->
<rule name="Change Location Header">
<match serverVariable="RESPONSE_LOCATION" pattern="^http://[^/]+/(.*)" />
<conditions>
<add input="{RESPONSE_STATUS}" pattern="^301" />
</conditions>
<action type="Rewrite" value="http://{HTTP_HOST}/{R:1}"/>
</rule>
</outboundRules>
但是只要将其添加到web.config中,我就会得到:
Module RewriteModule
Notification SendResponse
Handler ExtensionlessUrlHandler-Integrated-4.0
Error Code 0x8007000d
Config Error Unrecognized attribute 'serverVariable'
为什么无法识别该属性serverVariable
?