0
How to stop hotlinking and bandwidth theft
Hotlinking, also known as remote linking and direct linking, is a technique used to show your images and documents on someone else’s website. This means they use your bandwidth to show these images. They do a simple right click on the image, select properties and copy the URL of the file. Especially when your images rank high in Google image search, people start hotlinking them without permission. It’s easy to prevent hotlinking on your website, it can be done by uploading one simple file.
Create an .htaccess file, with the following code in it:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?campodiez.com [NC]
RewriteRule \.(jpeg|jpg|gif|png)$ http://example.org/bad.jpg [NC,R,L]
As you see in the third line of the code, I’ve added a domain. Replace this domain with one you’d like to allow hotlinking. If want to allow more domains, simply copy this line of code and paste it above the last line. You can change the filetypes you want to affect in the last line. You can also add extensions like .mp3 or .zip.
Replace ‘http://example.org/bad.jpg’ with the image you want to show when someone visits a hot linked image. Remember that this shouldn’t be on your own server, as you will create an endless loop.
After you’ve made your changes to the file, upload it to the directory where you store your images. It’s as simple as that!
Here are some resources:
Thanks to Blamcast.net for the original .htaccess file.



