Hotlink Protection – Protect Your Images!

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.

One Response to “Hotlink Protection – Protect Your Images!”

  1. Dennis says:

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

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word