为了减轻服务器负担,经常需要对一些附件进行访止盗链处理,比如图片。而在前面文章《16个简单实用的.htaccess技巧》介绍过,可以通过.htaccess来处理。
Options +FollowSymlinks
# Protect Hotlinking
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domainname.com/ [nc]
RewriteRule .*.(gif|jpg|png)$ http://domainname.com/img/hotlink_f_o.png [nc]
同样我们也可以通过cPanel控制台来配置实现。
首先是点击“HotLink保护”

进入“HotLink保护”配置页面,如下图:

这个真的不错,又学到一招啦
[回复]
« 盛大大力打击盗版,小说520、星空中文首当其冲通过cPanel防止盗链
[回复]
恩,这个学习一下子了,还真的说的相当的不错哟
[回复]
Hi, i think that i saw you visited my weblog so i got here to “go back the choose”.I’m attempting to in finding things to improve my site!I guess its adequate to make use of a few of your ideas!!
[回复]
Good post however I was wondering if you could write a litte more on this topic? I’d be very grateful if you could elaborate a little bit more. Cheers!
[回复]