【问题标题】:IIS URL Rewrite rule using request header使用请求标头的 IIS URL 重写规则
【发布时间】:2017-05-17 22:59:13
【问题描述】:

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

已经做了 2 个小时,但还是搞不定。有人可以帮忙吗?

谢谢

【问题讨论】:

    标签: iis url-rewrite-module


    【解决方案1】:

    终于明白了!以下是其他感兴趣的人的规则。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-27
      • 1970-01-01
      • 2014-05-01
      • 2011-04-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多