抓虾 鲜果
google reader QQ邮箱

为了减轻服务器负担,经常需要对一些附件进行访止盗链处理,比如图片。而在前面文章《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保护”配置页面,如下图:

相关文章

5 Responses to “通过cPanel防止盗链”

  1. 杭州网站优化 说道:

    这个真的不错,又学到一招啦

    [回复]

  2. 奢侈品 说道:

    « 盛大大力打击盗版,小说520、星空中文首当其冲通过cPanel防止盗链

    [回复]

  3. 变态传奇65535 说道:

    恩,这个学习一下子了,还真的说的相当的不错哟

    [回复]

  4. homepage 说道:

    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!!

    [回复]

  5. 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!

    [回复]

Leave a Reply