Forum Moderators: phranque

Message Too Old, No Replies

Conditional logging based on Query String

Conditional logging based on Query_String

         

Ashutosh

1:06 pm on Dec 26, 2011 (gmt 0)

10+ Year Member



We have a situation like user can bookmark an URL through which they can login in just one click. Such URLs have passwords as plain text. for ex.

[localhost...]

The requirement is not to log such GET requests when a param logonPassword is present in it.

I did something like below but it did not work..

RewriteEngine On
RewriteCond %{QUERY_STRING} !^logonPassword= [NC]
RewriteRule (.*) $1 [E=pwd:yes]
CustomLog logs/access.log common env=pwd

Any input?

lucy24

5:32 pm on Dec 26, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



^ means "starts with". The rule will only work if "logonPassword" is the very first item in your whole query string.

There are probably other issues, but that's the one that jumps up and screams "Notice Me!"