httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] Protecting Your Images
Date Mon, 22 Mar 2004 03:39:11 GMT

On Sun, 21 Mar 2004, Jack L. Stone wrote:
> Joshua: That was/is very useful info and I have the "FilesMatch" part
> working well. But, I thought I'd add the logging feature too, but I must
> hve something wrong on that one. It creates the "poachers.log" just fine,
> but nothing is logged. I figured it might be the "RewriteRule" flags just
> above the last line for the "CustomLog" line.

A couple points:

1. If you want help, you'll need to show *exactly* what configuration you
are using, along with relevant log entries.  You'll probably also need to
active the RewriteLog to see what mod_rewrite is doing.  (See the
mod_rewrite docs.)

2. Do you really need this poachers.log?  What do you expect to get out of
it, and can't you get that same information by looking through your
existing error and access logs?

3. I probably wouldn't mix mod_rewrite and mod_setenvif like that, because
you get into trouble if the modules run in the wrong order.  I would
either do it entirely in mod_rewite, as in:

RewriteEngine On
RewriteCond ${HTTP_REFERER} ^http://my\.apache\.org/
RewriteRule .*\.(gif|jpg) - [F,L,env=poach:1]
CustomLog logs/poachers_log combined env=poach

or I'd do it entirely with mod_setenvif:

SetEnvIfNoCase Referer "^http://my\.apache\.org/" local_ref=1
<FilesMatch "\.(gif|jpg)">
   Order Allow,Deny
   Allow from env=local_ref
   SetEnvIf local_ref 1 poach=1
CustomLog logs/poachers_log combined env=poach


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message