Forum Moderators: open

Message Too Old, No Replies

How to prevent hotlinking of specific images without .htaccess

         

abc123abc

12:01 pm on Oct 28, 2005 (gmt 0)

10+ Year Member



i saw semi simple html to do this, now i can't find it.

chriswragg

9:38 am on Oct 29, 2005 (gmt 0)

10+ Year Member



You can't prevent hotlinking with HTML (AFAIK), but you can make it that bit harder for people to find the image on your server. Because for an image to appear on your page you have to have some sort of location for it, whether in an img tag or in the css as a background image, someone wanting to hotlink it will be able to find it. Also, I find that the harder you try to hide an image location into the source code of a document, the more someone will want to try to get it.

Certainly one option other than html would be to use server side scripting like PHP, and create a dynamic image where it will only display if it has been reffered to by your domain.

Chris

AlexMiles

9:13 pm on Oct 29, 2005 (gmt 0)



There are more fun ways than that to discourage image hotlinking!

If I were you, I would rename any hotlinked images, then put up some 'educational' ones with the old names.

tedster

11:46 pm on Oct 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I once replaced a heavily hot linked image (it was appearing in a forum template) with an ad for the website that owned the image. It ran for 7 months before someone cared enough to remove the free ad they were running on their forum! Impressions were well into the high 6 figures.

abc123abc

1:00 am on Oct 31, 2005 (gmt 0)

10+ Year Member



we replace images sometimes, but when that image appears on multiple pages it can be a real pain to change the html for each.

jecasc

11:23 am on Oct 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could also slice the image in several parts. That makes it more difficult for others to get the image.