Forum Moderators: phranque

Message Too Old, No Replies

Avoid serving of images from outside

         

dcabbar

4:41 am on Oct 27, 2005 (gmt 0)

10+ Year Member



Hi,

There are some external sites who put links to images on my site directly, I mean they do not put a link to pages on my site, but gif/jpg images within an image tag, i.e. <img src="www.mysite.com/aa.gif">.

And, as you can imagine, I would like to prevent this, simply because they are sucking my bandwidth..

Is there any way I can avoid this? For example, can I write a rule in my .htaccess saying that if the image is requested within a page that is not on my domain (meaning referer is not my domain), do not serve this image kind of thing?

I would appreciate any input on this one, because these sites doubled my bandwith usage today...

Thanks...

jdMorgan

5:25 am on Oct 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This search [google.com] will get you started with example code and some discussion of important side-issues.

Jim