我想将所有传入流量从 重定向http://www.example.com
到
http://www.mysite.com/badreferer.aspx?bad=true
。
我正在研究 IIS7 和 asp.net 4.0 和 c#。
有什么办法可以在 IIS7 中进行配置?
<rule name="bad referer" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_REFERER}" pattern="(.*)example.com(.*)" />
<add input="{HTTP_REFERER}" pattern="(.*)example2.com(.*)" />
</conditions>
<action type="Redirect" url="/badreferer.aspx?bad=true" appendQueryString="false" />
</rule>
此规则会产生错误The webpage at http://www.mysite.com/badreferer.aspx?bad=true has resulted in too many redirects
。