httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Holthaus - Orange XL" <i...@orangexl.com>
Subject [users@httpd] RewriteEngine: unable to match REQUEST_URI
Date Fri, 07 Feb 2003 02:04:21 GMT
I have a real simple problem, but for some reason, I'm not able to solve it.

I want to write out a cookie on the basis of a query string:
REQUEST: http://www.mydomain.com/?'EATME

which should via the rewrite-engine be transformed to:
REQUEST: http://www.mydomain.com/
COOKIE: QUERYSTRING=EATME

Looks straighforward. I came up with something like this (tried many many
varitions, this is just one)

RewriteEngine on
    # Turn on Rewrite engine

RewriteCond %{QUERY_STRING} !^$
    #  Select a request which contains a ?

RewriteRule ^([^?]*)\?(.*)$     http://www.mydomain.com$1
[R,CO=querystring:$2:.mydomain.com]
    # put eveything without/until a ? in $1, put everything after a/the
first ? in $2
    # $1 will be the redirect-uri
    # $2 will be written as a cookie

The problem seems to the \? in the regex of the rewriterule. The regex will
not match addresses with a ? in them.

Can anyone help me out here? Thanx!

Kind regards,
Sander Holthaus


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


Mime
View raw message