Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Images..

0 views
Skip to first unread message

Barely Audible

unread,
Nov 17, 2009, 4:01:46 AM11/17/09
to
At the moment other sites hot-linking to images on my site are taking up
a fair proportion of my traffic - is there a way to prevent this?

--
TTFN
Jim

War can only be abolished through war, and in order to get rid of the
gun it is necessary to take up the gun.
-- Mao Zedong

Davide Bianchi

unread,
Nov 17, 2009, 4:05:21 AM11/17/09
to
On Nov 17, 10:01 am, Barely Audible <anywh...@but.here> wrote:
> At the moment other sites hot-linking to images on my site are taking up
> a fair proportion of my traffic - is there a way to prevent this?

Yes and no. You can do something using mod_rewrite but there are many
ways to circumvent those 'blocks'.
A quick search on google will return you many receipt for rewrite but
be aware that most of the time is just a workaround.

Davide

Barely Audible

unread,
Nov 21, 2009, 2:36:24 PM11/21/09
to

Thanks Davide!

--
TTFN
Jim

There is no such thing as military 'intelligence'.
-- Murphy's Military Laws, #39

Jan C. Faerber

unread,
Nov 21, 2009, 3:15:21 PM11/21/09
to

Isn't that interesting?
I googled aswell now - just want to post three links here - the 3rd
one with php
http://altlab.com/hotlinking.html
http://altlab.com/htaccess_tutorial.html
http://www.alistapart.com/articles/hotlinking/

David Pyles

unread,
Nov 21, 2009, 4:26:05 PM11/21/09
to
On 11/21/2009 2:36 PM, Barely Audible wrote:
> Davide Bianchi wrote:
>> On Nov 17, 10:01 am, Barely Audible <anywh...@but.here> wrote:
>>> At the moment other sites hot-linking to images on my site are taking up
>>> a fair proportion of my traffic - is there a way to prevent this?
>>
>> Yes and no. You can do something using mod_rewrite but there are many
>> ways to circumvent those 'blocks'.
>> A quick search on google will return you many receipt for rewrite but
>> be aware that most of the time is just a workaround.
>>
>> Davide
>
> Thanks Davide!
>
Here's a .htaccess script that works for me.
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?YOURDOMAINNAME\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png|jpg)$ YOURIMAGENAME.jpg [L]

I use this .htaccess file in a folder where I have thousands of scanned
CD cover images that are very tempting to outsiders. The ALL CAPS would
be replaced with your information as appropriate. The jpg image name in
the last line is an image that is served instead of the image requested.
In my case, I use my site's logo.

There are probably ways around this, but it would take some
sophistication to do it.

Dave Pyles

0 new messages