分享

写回答

发帖

[提问] 关于win防盗链的代码使用

GoDaddy GoDaddy 698 人阅读 | 3 人回复

发表于 2011-8-27 08:53:59 | 显示全部楼层 |阅读模式

<configuration>
<system.webServer>
    <rewrite>
      <rules>
        <rule name="Prevent hotlinking">
          <match url="^.*\.(rar|zip)$" ignoreCase="true" />
          <conditions>
            <add input="{HTTP_REFERER}" pattern="^$" negate="true" />
            <add input="{HTTP_REFERER}" pattern="http://www.idcspy.com/.*" negate="true" />
            <add input="{HTTP_REFERER}" pattern="http://www.idcspy.cn/.*" negate="true" />
            <add input="{HTTP_REFERER}" pattern="http://bbs.idcspy.com/.*" negate="true" />
          </conditions>
          <action type="Rewrite" url="/offlink.gif" />
        </rule>
      </rules>
    </rewrite>
</system.webServer>
</configuration>

这是我在论坛上找到的,有几个问题
中间的网站要写几个?这个文件是放在主目录还是每个子目录下,如果目录下已经有了web.config了那怎么添进去?

回答|共 3 个

lwbo1987

发表于 2011-8-27 08:56:40 | 显示全部楼层

这些都是自定义的,自己想写几个就几个,文件放在什么目录下都可以,只要添加URL的时候把子目录加上就可以了,一般放在根目录
回复 支持 反对

使用道具 举报

nicc1986

发表于 2011-8-27 09:12:22 | 显示全部楼层

回复 2# 的帖子

放在根目录,就是全部网站都有效果了?
回复 支持 反对

使用道具 举报

lwbo1987

发表于 2011-8-27 09:15:59 | 显示全部楼层

回复 3# 的帖子

是的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则