apache、iis規則設置防盜鏈Linux下規則文件.htaccess(手工創建.htaccess文件到站點根目錄) <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !baidu.com [NC]
RewriteCond %{HTTP_REFERER} !google.com [NC]
RewriteCond %{HTTP_REFERER} !xxx.net [NC]
#RewriteCond %{HTTP_REFERER} ^$ [NC]
RewriteRule .*\.(gif|jpg|png|css|js|rar|zip|mp4|pdf)$ /band.txt [NC,L]
</IfModule>注:xxx.net是您自己的域名,band.txt是被盜鏈后的提示內容文件 Windows2008、2012或更高系統下規則文件web.config (手工創建web.config文件到站點根目錄) <?xml version="1.0" ?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="rule1" stopProcessing="true">
<match url="^.*\.(gif|jpg|png|css|js|rar|zip|mp4|pdf)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAny" >
<add input="{HTTP_REFERER}" pattern="您的域名.com(不用加www)" negate="true" />
<!--<add input="{HTTP_REFERER}" pattern="^$" />-->
</conditions>
<action type="AbortRequest" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>請參照工單,根據實際情況設置。 如需我司幫助設置,請提交工單,根據實際問題收費30元-200元
|
|||||
| >> 相關文章 | |||||
