httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krist van Besien" <>
Subject Re: [users@httpd] How to SetEnvIf matching previous matches
Date Tue, 13 Feb 2007 11:35:56 GMT
On 2/9/07, Lucas Brasilino <> wrote:
> Hi all:
> I'm trying to make a 'AND' beetween two 'SetEnvIf' matches
> with no success. In mod_setenv docs it says that the
> 'attribute' field can be the name of an enviroment variable
> of a previous match. I've tried many configurations with no
> success. Maybe I'm misunderstading the docs...
> SetEnvIf Request_URI "\.pdf$" IS_pdf
> BrowserMatch MSIE IS_ie
> How can I make a 'AND' beetween 'IS_pdf' and 'IS_ie'
> to set 'Pragma_NoCache' and do a:
> Header set Pragma "no-cache" env=Pragma_NoCache

As far as I know you can't do boolean logic in SetEnvIf request. There
is workaround however. I had a similar problem, where I needed to set
a header based on the presence of two other headers. The trick was to
use a ReWriteRule, but solely for its side effects, not rewriting any
URLS. The advantage is that you can AND and OR several ReWriteCond
statements, but in your case you would only need one, as you can doe
the URI machting in the ReWriteRule itself:

ReWritecond  ยง{HTTP_USER_AGENT}  MSIE
ReWriteRule    ^(.*\.pdf)$    $1      [E:Pragma_NoCache=yes]

Header set Pragma "no-cache" env=Pragma_NoCache


Bremgarten b. Bern, Switzerland
"...what you don't realize is that in the future Google WILL reach
sentience, will [have had] invent[ed] a time machine, and will [have
had] travel[ed] back in time to prevent Bill Gates... only to become
Bill Gates by accident because of a search engine optimization
miscalculation." (Comment on the Dilbert Blog)

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