Go DataKL

April 28, 2008

Hotlink Protection – Protect Your Images!

Filed under: General — admin @ 10:09 am

Here is a tip that you can save up your bandwidth usage. If you believe that other people is hotlinking your images. This option can be enabled in Cpanel under hotlink protection, but if you are an experienced webmaster and have a lot of entries in your .htaccess file you may want to edit your .htaccess manually to better organize your rules.

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://domain.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ – [F,NC]

You can add more HTTP_REFERRER for domains within your allowed list, for example another web site or your subdomain.

Include this in your images folder or any folder to ensure that your images are protected.

1 Comment »

  1. Thanks for the info. I never know preventing hotlink can be as easy as a mouse click!

    Comment by Dennis — June 7, 2008 @ 7:40 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Why ask?

Powered by WordPress