You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joshua Slive <js...@gmail.com> on 2005/09/13 17:55:41 UTC

Re: [users@httpd] SetEnvIf[NoCase] and url get attributes

On 9/13/05, sven buerger <fr...@brotbuexe.de> wrote:
> Hi,
> 
> i've tried many things to get a setenvif working with GET-parameters in
> a url. The problem, i can only use the url till the ? marker. I will
> explain by example
> 
> 
> http://locahost/index.php?test=1
> 
> i want to check the existence of test. i tried
> 
> setenvifnocase Request_URI test test=1
> 
> but this doens't work. i've tried

As the docs say, Request_URI does not include the query string.  I
believe you'd need to use mod_rewrite for this:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^test=1$
RewriteRule .* - [E=test:1]

Be sure to use the RewriteLog for debugging.

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


Re: [users@httpd] Re: SetEnvIf[NoCase] and url get attributes

Posted by Joshua Slive <js...@gmail.com>.
On 9/13/05, sven buerger <fr...@brotbuexe.de> wrote:
> hi,
> 
> 13.09.2005 17:55 Joshua Slive wrote:
> > As the docs say, Request_URI does not include the query string.  I
> > believe you'd need to use mod_rewrite for this:
> 
> But then query_string should work?
> 
> and for example http://www.tolatsga.org/info.php?test=1 under
> environment the request_uri includes the ?test=1 and I didn't find any
> document that described anything other.

No.  See:
http://httpd.apache.org/docs/2.0/mod/mod_setenvif.html#setenvif
and
http://httpd.apache.org/docs/2.0/env.html

SetEnvIf matches only against the specific things listed in the docs. 
One of those things is "environment variables", but you'll note that
QUERY_STRING is not a variable in the apache environment.  It is added
to the environment only when launching CGI and SSI scripts.

Yes, it would be nicer if apache were more consistent about what
variables are available where.  But the environment variables docs do
try to be explicit about it.

Joshua.

> 
> I don't like the mod_rewrite for this "little" problem.  hope there is
> any other solution.
> 
> bye
> 
> 
> ---------------------------------------------------------------------
> 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


[users@httpd] Re: SetEnvIf[NoCase] and url get attributes

Posted by sven buerger <fr...@brotbuexe.de>.
hi,

13.09.2005 17:55 Joshua Slive wrote:
> As the docs say, Request_URI does not include the query string.  I
> believe you'd need to use mod_rewrite for this:

But then query_string should work?

and for example http://www.tolatsga.org/info.php?test=1 under
environment the request_uri includes the ?test=1 and I didn't find any
document that described anything other.

I don't like the mod_rewrite for this "little" problem.  hope there is
any other solution.

bye


---------------------------------------------------------------------
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