I'm retiring the legacy site http://extranet.contoso.com but there's a specific functionality that will be needed for a while still. What I'm trying to achieve is the redirection of all requests to an info page at https://contoso.com/new-extranet-info-page/, excluding requests to http://extranet.contoso.com/printdoc.aspx?ID=1234567&AccountID=vd3l1bn&UserID=Matt which should still go through without being redirected. I'm sure it's something simple and obvious but can't figure it out. This is redirecting all requests to the info page as if the negate is being ignored.
<rule name="Redirect to new service" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_URI}" pattern="^/printdoc\.aspx(\?.*)?$" negate="true" />
<add input="{HTTP_HOST}" pattern="^extranet\.contoso\.com$" />
</conditions>
<action type="Redirect" url="https://contoso.com/new-extranet-info-page/" appendQueryString="false" />
</rule>
The negate passes validation when I test it against /printdoc.aspx?ID=1234567&AccountID=vd3l1bn&UserID=Matt. I tried disabling any other rewrite rules present but that has no effect.