PDA

View Full Version : Hot Link Protection : stop people linking to your images.


nicholas
06-28-2003, 11:46 AM
it can be done with .htaccess files,

heres some info I found, its easy to make a .htaccess file and upload it to the directory where you wish to protect.
Here is an example you can copy for other images and directories


this page this image http://yourdomain.com/images/various/test.jpg
will be protected with this .htaccess file



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



Save this file as htaccess.txt, then upload it into the folder where you want the files restricted (usually your images folder).
Rename the file to .htaccess (remember the dot!!) and the file will become 'invisible' to most ftp programs.
Test linking an image from another webpage, forum etc to make sure it works ok.

James
09-15-2004, 05:57 PM
Hey Nicolas..

Here is another way mate. Login to CPanel and click on the HotLink Protection link.

In the box provided add a new line with the "Website" you want to be allowed to access these files even though "Hotlink Protection" is enabled. When doing this and adding a new website you must click on Activate to allow the new "Websites".

Were it says "Extensions to allow (seperate by commas)" add the extentions you don't want to be taken without permission. Defaults are jpg jpeg gif png bmp, you can add more or less depending on what you want to protect.

When you have done all this click Activate and your set it's as simple and quick as that :)