Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: phranque

Message Too Old, No Replies

Block a site that only hotlinks my images

   
6:24 pm on Jun 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have hotlink protection allowing only certain sites to hotlink my images, however there is 3 or 4 sites (mostly forums or social networks) appearing in 404 error, mostly posts hot linking my images, what is annoying.
Is there anything else I can do to completely ban those?
Should I add an .htaccess line like

Deny from (IP)?

9:18 am on Jun 26, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I have hotlink protection

how are they hotlinking?
or how are you protecting such that they can bypass the protection?

there are a ton of image hotlinking [google.com] threads on WebmasterWorld.

5:06 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



they are linking images directly such as img="http://mysite.com/myimagebeinghotlinked.jpg" I'm not being bypassed by protrection, in fact the image don't show in their sites, but they still have the link there, and therefore I get the 404.

I sticky the protection code but on't want to post ideas about how bypassing the protection

5:21 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Don't serve a 404,

What I do it serve a "hotlink" image so that when they request /myimagebeinghotlinked.jpg they get served /anit_hotlinking_image.jpg

Then I make the anit_hotlinking_image.jpg a picture of my website with the url across it.
Or "Image Available at sitename.com"

Usually if you promote your site in the image it isn't long before they take it down.

7:59 am on Jun 29, 2009 (gmt 0)

10+ Year Member



Then I make the anit_hotlinking_image.jpg a picture of my website with the url across it.
Or "Image Available at sitename.com"

I like this method, but question: when I do this, the anti-link image I serve up on the other website stays in the visitor's cache, and thus when they come to my site they still see the anti-link image and not the real image (until they hit reload). Any suggestions?

8:10 am on Jun 29, 2009 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



they still see the anti-link image and not the real image (until they hit reload). Any suggestions?

How would they see the same image? Arriving via browser to your site should cause the browser to read everything "new"! Unless I'm missing something, you'll be serving the real image to your site visitors, not the anti-hotlink image...

8:18 am on Jun 29, 2009 (gmt 0)

10+ Year Member



that hasn't been my experience. Just tested in both Opera and Firefox.
11:48 am on Jun 29, 2009 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Clear YOUR browser cache first, then try again, might be giving bad test results. Doesn't make sense that if presented with a DIFFERENT filename for the image the browser would show the undesired image...
3:17 pm on Jun 29, 2009 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



try putting the anti_hotlinking_image.jpg in a different directory from the real images.

That might give Firefox a new path and it may not cache it.

It really shouldn't be though if they have different names.

3:33 pm on Jun 29, 2009 (gmt 0)

10+ Year Member



Yeah still no. Below is the code I'm using, maybe the problem is there?

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?ebay\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?cgi.ebay\.com/ [NC]
RewriteRule \.(jpe?g¦gif¦png)$ images/nohotlink.gif [L]

edit: let me test that, Demaestro.

[edited by: MWpro at 3:34 pm (utc) on June 29, 2009]

5:34 pm on Jun 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't like that method really because all hotlinkers sitll eat your bandwidth, affecting your site speed and even making you pay more in hosting bandwidth... don't you think?
7:38 pm on Jun 29, 2009 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Depends on your hosting package I guess.

For me bandwidth is a non issue, images on sites with high traffic volume are hosted from a remote server so that image calls don't affect the sites' speed.

If Ebay is hot-linking images from your site don't you think having your site URL and a message in those images encouraging people to buy from you or visit you is worth it? I do.

2:37 pm on Jul 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



images on sites with high traffic volume are hosted from a remote server so that image calls don't affect the sites' speed.

I guess you are not talking about free hosting images right? Do they pay another hosting service just to place images there and leave the main hosting account with just html files?

2:41 pm on Jul 2, 2009 (gmt 0)

WebmasterWorld Senior Member demaestro is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Do they pay another hosting service just to place images there and leave the main hosting account with just html files?

No, it's something my sys guy set up so that shared servers are snappy. He sits around all day and thinks this stuff up, it makes him happy.

edit... that rhymes by accident.

[edited by: Demaestro at 2:41 pm (utc) on July 2, 2009]

6:30 pm on Jul 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about this: is it possible to wrap a link around the image. Clickeable image instead one saying "visit my site"?
10:59 pm on Jul 2, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



if the browser is rendering an image tag and requests the url for the image it is expecting a response that is an image-type resource.
as soon as you respond with html, the Content-type of your response would be text/html rather than image/* so it won't render properly.