Re: How to SetEnvIf matching previous matches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/9/07, Lucas Brasilino <lucas.brasilino@xxxxxxxxx> 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

Krist

--
krist.vanbesien@xxxxxxxxx
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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux