On 5/21/07, Krist van Besien <[EMAIL PROTECTED]> wrote:
On 5/21/07, West, Chris <[EMAIL PROTECTED]> wrote:
> Hi Krist,
>
> Sorry to get back to you again, I have tried the format you described
> and still have problems, is the following how you would expect the
> rewrite condition to look?  I have tried both, neither giving the result
> expected.
>
> 1.
>
>     RewriteCond %{HTTP_REFERER} ^.*%{ENV:SERVER_NAME}.*$ [OR]
>     RewriteCond %{HTTP_REFERER} ^$
>     RewriteRule .* - [E=dont_log_referer:true]
>
> 2.
>
>     RewriteCond %{ENV:HTTP_REFERER} ^.*%{ENV:SERVER_NAME}.*$ [OR]
>     RewriteCond %{ENV:HTTP_REFERER} ^$
>     RewriteRule .* - [E=dont_log_referer:true]

After your other mail I know know that it is the "internal variable"
SERVER_NAME that you want to test against, and in this case
%{SERVER_NAME} ought to be correct. %{HTTP_REFERER} is also correct.

What could be your problem is that SERVER_NAME is not containing what
you expect, and that therefore the rule doesn't match. Have you tried
turning rewritelog on, and setting the loglevel to 9? This ought to
give you a ton of information.

In any case, this isn't going to work. The regular expression used in
RewriteCond (and RewriteRule and SetEnvIf) cannot contain variables.
It is compiled at server-start and doesn't have access to anything
per-request.

I don't think there is any way to do exactly what you want with
standard modules. You'll need to specify the ServerName explicitly in
the rules.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to