httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] Rewrite-problem
Date Mon, 10 Feb 2003 00:16:08 GMT

On Mon, 10 Feb 2003, Sander Holthaus - Orange XL wrote:

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

Ahhh... If you want to cut off the query string, you need to tag a ? on to
the end of the RewriteRule.  By default, mod_rewrite passes the query
string from the original request to the new request untouched.  It is NOT
matched in the (.*).  This is all in the docs (although, admittedly, so
are a million other things; the mod_rewrite docs are quite dense).

> RewriteEngine on
> # RewriteCond %{QUERY_STRING} !^$   # always true?!
> RewriteCond %{QUERY_STRING} (.*)
> RewriteRule ^(.*)$1
> [R,CO=campaign:$]

RewriteCond %{QUERY_STRING} (.*)
RewriteRule ^(.*)$1? [R,]

You need to use %1 to get the back-reference.  $2 will be empty.

And don't even think about filing a bug report on this until you have
tried the RewriteLog at RewriteLogLevel 9 to see exactly what mod_rewrite
is doing.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message