Re: Query-String Access from SetEnvIf

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

 



Thanks for the help, but you didn't read all the way through the original message.
Someone suggested that I try the Query_String variable so I did. I didn't get an error, but there was nothing in the Query_String variable. I was just commenting that by simply referencing an undefined variable seems to create it as an empty variable.

I actually don't care what the variable is called or how I reference it, I just need to evaluate the contents of the query-string porting of a URL (query-string is the official name of the argument string in a URL).

Again, thanks for trying.

Does anyone know how I can get ahold of the query-string (argument list) using SetEnvIf?

----- Original Message ----
From: Krist van Besien <krist.vanbesien@xxxxxxxxx>
To: users@xxxxxxxxxxxxxxxx
Sent: Monday, February 5, 2007 5:26:21 AM
Subject: Re: [users@httpd] Query-String Access from SetEnvIf

On 2/3/07, tyju tiui <jckdnk111@xxxxxxxxx> wrote:
>
> Sorry, you're missing the point I think.

I don't think I missed your point. You want to trigger custom logging
based on the content of the Query string.

The following will do exactly that:

# Set an environment variable when the query string matches a certain string.
# Modify the string you match against according to your requirements.
# In this example any non empty query string matches.
RewriteCond %{QUERY_STRING} !^$
RewriteRule  (.*)   $1 [E=dolog:yes]
# Use the env variable set above to trigger logging to a separate file.
CustomLog logs/querylog  combined env=dolog

Since in your original exampel you tried to set an environment
variable based on the presence of a query string I asumed that you
planned to use this environment variable to trigger custom logging,
and hence I thought that you allready figured out that part of the
solution.

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




Have a burning question? Go to Yahoo! Answers and get answers from real people who know.
[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