不过,我使用此代码是为了防止图像热链接。
<rule name="Prevent Hotlinking">
<match url=".*\.(jpg|jpeg|png|gif|bmp)$"/>
<conditions>
<add input="{HTTP_REFERER}" pattern="^$" negate="true" />
<add input="{HTTP_REFERER}" pattern="^http://domain\.com/.*$" negate="true" />
</conditions>
<action type="Rewrite" url="/img/hotlink-logo.png" appendQueryString="false" />
</rule>然而,当我访问HTTPS部分时,我的所有图像都被替换为hotlink-logo.png。我尝试添加第二条规则来管理hTTPS请求,但也出现了同样的问题。
我尝试为HTTPS添加第二个条件,但随后又允许热链接。
有什么建议吗?谢谢
发布于 2014-01-13 20:35:57
您需要在regex中包含两个URL:
^https?://domain\.com/.*$https://stackoverflow.com/questions/21100797
复制相似问题