How to prevent hot linking


Use this tutorial to prevent people from hot linking your files.
Note: Make sure your host has mod-rewrite turned on.

Steps :
Create a .htaccess file and place the following [ If you do not know what a .htaccess file is, search google]

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

Replace mydomain.com with your domain name eg. www.westernstudios.net

Place the .htaccess file inside the folder with the images or files you want to protect.

If you would like to add a pic that violators would see. Change the code to the following

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/nasty.gif [R,L]

Change mydomain.com to your domain and create an image name nasty.gif and place in your root folder.

That's all. Visit our forums for more help.