使用请求头的IIS URL重写规则

使用请求头的IIS URL重写规则,iis,url-rewrite-module,Iis,Url Rewrite Module,我一直在尝试创建一个IIS重写规则,该规则查看API的传入标头,如果它包含特定字符串,则将它们重新定向到特定页面,而不是API(Noobs-使用文档API键) 已经做了两个小时了,但还是做不出来。有人能帮忙吗 谢谢终于拿到了!以下是其他感兴趣的人的规则 <rewrite> <rules> <rule name="Rewrite Noob Documentation API Key" enabled="true" st

我一直在尝试创建一个IIS重写规则,该规则查看API的传入标头,如果它包含特定字符串,则将它们重新定向到特定页面,而不是API(Noobs-使用文档API键)

已经做了两个小时了,但还是做不出来。有人能帮忙吗


谢谢

终于拿到了!以下是其他感兴趣的人的规则

     <rewrite>
        <rules>
            <rule name="Rewrite Noob Documentation API Key" enabled="true" stopProcessing="true">
                <match url=".*" />
                <conditions>
                    <add input="{HTTP_Authorization}" pattern="^ukvd-ipwhitelist ABCD1234-1b3d-4d63-aa75-ABCDEF123456$" />
                </conditions>
                <action type="Redirect" url="https://xxx.co.uk/dockey.html" appendQueryString="false" />
            </rule>
        </rules>
    </rewrite>