You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mohit Chawla <mo...@gmail.com> on 2016/07/27 16:47:24 UTC

[users@httpd] Using SetEnvIf for QUERY_STRING

Hi,

I am trying to use SetEnvIf with QUERY_STRING, but can't get it to work.
This is being done inside the mod_deflate module block like:

<IfModule mod_deflate.c>
SetEnvIf QUERY_STRING foo var=bar
LogFormat '"%q" "%{var}e"'
</IfModule>

...with a request like curl localhost?baz, the log has:
"?baz" "-"

Other variables like REQUEST_METHOD work fine:
<IfModule mod_deflate.c>
SetEnvIf REQUEST_METHOD GET var=bar
LogFormat '"%q" "%{var}e"'
</IfModule>
$ curl localhost?baz
"?baz" "bar"

Apache version is 2.2.22 on Ubuntu 12.04.

Any ideas how to debug or fix this ?

Thanks,
Mohit

[users@httpd] Re: Using SetEnvIf for QUERY_STRING

Posted by Mohit Chawla <mo...@gmail.com>.
Just a correction:
In the first example, I mistakenly wrote foo in the SetEnvIf statement, it
is:
SetEnvIf QUERY_STRING baz var=bar

On Wed, Jul 27, 2016 at 6:47 PM, Mohit Chawla <mohit.chawla.binary@gmail.com
> wrote:

> Hi,
>
> I am trying to use SetEnvIf with QUERY_STRING, but can't get it to work.
> This is being done inside the mod_deflate module block like:
>
> <IfModule mod_deflate.c>
> SetEnvIf QUERY_STRING foo var=bar
> LogFormat '"%q" "%{var}e"'
> </IfModule>
>
> ...with a request like curl localhost?baz, the log has:
> "?baz" "-"
>
> Other variables like REQUEST_METHOD work fine:
> <IfModule mod_deflate.c>
> SetEnvIf REQUEST_METHOD GET var=bar
> LogFormat '"%q" "%{var}e"'
> </IfModule>
> $ curl localhost?baz
> "?baz" "bar"
>
> Apache version is 2.2.22 on Ubuntu 12.04.
>
> Any ideas how to debug or fix this ?
>
> Thanks,
> Mohit
>