in reply to anti leech CGI

What color would you like that wheel you're about to reinvent? chrome? wood? rubber?

There's no need to push this down into the perl side of things, when Apache has facilities built-in that can handle this at the request level. Look into mod_rewrite, and more specifically, the URL Rewriting Guide, specifically the "Blocked Inline-Images" section about 80% of the way down. I use this method on several of my sites, and it works wonderfully (it's not just for images).

To summarize:

<Directory /path/to/domain.org/> AllowOverride None RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://domain.org/.*$ [NC] RewriteRule .*\.(png|gz|zip|)$ http://domain.org/no.png [R] </Directory>

Replies are listed 'Best First'.
Re: Re: anti leech CGI
by hiseldl (Priest) on Oct 30, 2002 at 15:13 UTC

    What if your wheel doesn't fit? See my reply to erasei.

    Thanks for the summary of the Apache config though.

    --
    hiseldl
    What time is it? It's Camel Time!