【发布时间】:2012-04-19 08:59:10
【问题描述】:
我的网站上有一个用于缓存大型 Flash 电影的文件夹,我想阻止其他人将它们嵌入他们的网站;我想尝试仅使用web.config 文件来执行此操作。这怎么可能?
我对规则的第一次尝试(不起作用):
以下规则应该阻止公共访问(和嵌入)缓存文件夹“CurrentCache”-http://myurl.com/ContentCache/ 中的 .swf 文件,并改为提供替换电影“NoEmbedFromCacheSWF.swf”。
<rule name="Prevent SWF hotlinking" enabled="true">
<match url="^(ContentCache)(.swf)$" ignoreCase="true" />
<conditions>
<add input="{HTTP_REFERER}" pattern="^http://(.*\.)?myurl\.com/.*$" negate="true" />
</conditions>
<action type="Rewrite" url="/Content/Flash/NoEmbedFromCacheSWF.swf" />
</rule>
提前致谢!
注意:我认为我在<match url="A swf inside /ContentCache/" ignoreCase="true" /> 行中弄错了正则表达式,有什么想法吗?
【问题讨论】:
标签: asp.net .net web-config url-rewrite-module