You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Fenlason, Josh" <jf...@ptc.com> on 2006/10/05 21:20:48 UTC

[users@httpd] SetEnvIfNoCase regex help

I'm trying to set no-gzip dont-vary when the content-type is
"application/pdf" or "application/zip", but I'm having trouble getting
the regex portion of the SetEnvIfNoCase directive right.  Here's what I
have so far that doesn't work:
    SetEnvIfNoCase Content-Type \
    ^(application/pdf|application/zip)$ no-gzip dont-vary
If anyone has any tips or suggestions, I would be extremely grateful.
Thanks in advance.
,
Josh.

RE: [users@httpd] SetEnvIfNoCase regex help

Posted by "Fenlason, Josh" <jf...@ptc.com>.
That's good to know.  I couldn't figure out why it wasn't working.  :)
Thanks for the quick response.
,
Josh. 

> -----Original Message-----
> From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of 
> Joshua Slive
> Sent: Thursday, October 05, 2006 2:25 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] SetEnvIfNoCase regex help
> 
> On 10/5/06, Fenlason, Josh <jf...@ptc.com> wrote:
> >
> >
> > I'm trying to set no-gzip dont-vary when the content-type is 
> > "application/pdf" or "application/zip", but I'm having 
> trouble getting 
> > the regex portion of the SetEnvIfNoCase directive right.  
> Here's what 
> > I have so far that doesn't work:
> >     SetEnvIfNoCase Content-Type \
> >     ^(application/pdf|application/zip)$ no-gzip dont-vary If anyone 
> > has any tips or suggestions, I would be extremely grateful.
> > Thanks in advance.
> 
> SetEnvIf matches request headers, not response headers.  So 
> this won't work at all.
> 
> You can either set the variables based on characteristics of 
> the request (like the Request_URI), or you can use mod_filter 
> (in 2.2) to activate the filter based on response content type.
> 
> 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: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SetEnvIfNoCase regex help

Posted by Joshua Slive <jo...@slive.ca>.
On 10/5/06, Fenlason, Josh <jf...@ptc.com> wrote:
>
>
> I'm trying to set no-gzip dont-vary when the content-type is
> "application/pdf" or "application/zip", but I'm having trouble getting the
> regex portion of the SetEnvIfNoCase directive right.  Here's what I have so
> far that doesn't work:
>     SetEnvIfNoCase Content-Type \
>     ^(application/pdf|application/zip)$ no-gzip dont-vary
> If anyone has any tips or suggestions, I would be extremely grateful.
> Thanks in advance.

SetEnvIf matches request headers, not response headers.  So this won't
work at all.

You can either set the variables based on characteristics of the
request (like the Request_URI), or you can use mod_filter (in 2.2) to
activate the filter based on response content type.

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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org