IIS Url Rewrite - Attribute 'serverVariable' not defined

0
  • IIS 10, Windows 10

I have installed URL Rewrite Module 7.2.1993 and am now trying to replicate the example show here: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-20-configuration-reference#setting-response-headers namely:

<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>

however as soon as I add that to my web.config I get:

Module     RewriteModule
Notification       SendResponse
Handler    ExtensionlessUrlHandler-Integrated-4.0
Error Code     0x8007000d
Config Error       Unrecognized attribute 'serverVariable'

Why is that attribute serverVariable not being recognised?

iis
mod-rewrite
iis-10
asked on Stack Overflow Mar 25, 2019 by TheEdge

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0