IIS Url Rewrite - Attribute 'serverVariable' not defined

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

    <!-- This rule changes the domain in the HTTP location header for redirection responses -->
    <rule name="Change Location Header">
        <match serverVariable="RESPONSE_LOCATION" pattern="^http://[^/]+/(.*)" />
            <add input="{RESPONSE_STATUS}" pattern="^301" />
        <action type="Rewrite" value="http://{HTTP_HOST}/{R:1}"/>

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?

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