Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 11968 invoked by uid 500); 10 Feb 2003 06:10:45 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 11945 invoked from network); 10 Feb 2003 06:10:45 -0000 Received: from unknown (HELO squarehosting.com) (12.158.191.98) by daedalus.apache.org with SMTP; 10 Feb 2003 06:10:45 -0000 Received: from mars.uni ([12.158.191.98]) by squarehosting.com (8.11.6/8.11.6) with SMTP id h1A68lL23444 for ; Mon, 10 Feb 2003 01:08:47 -0500 Date: Mon, 10 Feb 2003 00:17:33 -0500 From: Jurgen To: users@httpd.apache.org Message-Id: <20030210001733.00ec2282.apache@squarehosting.com> In-Reply-To: <000b01c2d09d$0359e0e0$0200a8c0@FamHolthaus> References: <005701c2d094$7306fc10$0200a8c0@FamHolthaus> <000701c2d09a$b7c6b830$0200a8c0@FamHolthaus> <000b01c2d09d$0359e0e0$0200a8c0@FamHolthaus> X-Mailer: Sylpheed version 0.7.0 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: Re: [users@httpd] Rewrite-problem Hi, I don't know if this resolved or not, but maybe you try something like this: # you might want to use a + if you want to test for the existence of a query string RewriteCond %{QUERY_STRING} ^(.+)$ # The ? after the end of the redirection removes the query string. RewriteRule ^(.*) http://www.otherdomain.nl/$1? [R,CO=campaign:%1:.domain.nl] Jurgen On Mon, 10 Feb 2003 01:40:30 +0100 "Sander Holthaus - Orange XL" wrote: > Sorry, my appologies, the cookie IS written, I forgot to use % instead of $. > But the ? is still in the path. > > ----- Original Message ----- > From: "Sander Holthaus - Orange XL" > To: > Sent: Monday, February 10, 2003 1:24 AM > Subject: Re: [users@httpd] Rewrite-problem > > > > Thanks Josh, but that's not the case. The ? is in the path and I just > cannot > > seem to get it to match. > > I tried you suggestion (and a few variations of it) but it puts the server > > in an infinite loop, because as I said, the ?-mark is in the path found by > > Apache, and thus the rewritten URL also has a querystring in it. > > > > I used: > > > > RewriteEngine on > > # RewriteCond %{QUERY_STRING} !^$ # always true?! > > RewriteCond %{QUERY_STRING} (.*) > > RewriteRule ^(.*) http://www.otherdomain.nl/$1 > > [R,CO=campaign:$2:.domain.nl] > > > > I don't really know what is, but after some extensive testing, I can only > > conclude that the rewrite-engine in Apache 2 is still bugged. I could have > > used $4 or whatever in the above example, it still would have done the > same, > > the full path AND query_string are appended to the redirect-URL and the > > cookie is NOT written. > > > > Should I file a bugreport or am I really missing something here? > > > > Kind Regards, > > Sander Holthaus > > > > ----- Original Message ----- > > From: "Joshua Slive" > > To: > > Sent: Monday, February 10, 2003 12:22 AM > > Subject: Re: [users@httpd] Rewrite-problem > > > > > > > > > > On Mon, 10 Feb 2003, Sander Holthaus - Orange XL wrote: > > > > 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. > > > > > > RewriteRule matches only the URL-Path not including the query string. > To > > > match the query string, you need to use a RewriteCond as in > > > > > > RewriteCond %{QUERY_STRING} (.*) > > > RerwiteRule ^(.*) http://www.domain.com/$1 > > [R,CO=querystring:%1:.mydomain.com] > > > > > > where the %1 is a backreference to the match in the RewriteCond. > > > > > > I haven't tested this, but it should point you in the right direction. > > > > > > Joshua. > > > > > > --------------------------------------------------------------------- > > > The official User-To-User support forum of the Apache HTTP Server > Project. > > > See 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 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 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 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