httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Neigaard <>
Subject RE: [users@httpd] mod_rewrite matching on querystring?
Date Wed, 30 Jun 2004 14:08:57 GMT
-----Original Message-----
From: Joshua Slive [] 
Sent: 30. juni 2004 15:42
Subject: Re: [users@httpd] mod_rewrite matching on querystring?

On Wed, 30 Jun 2004 15:25:01 +0200, Søren Neigaard
<> wrote:
> Ive tried to get mod_rewrite to match this url (the complete url, and only
the complete url):
>   /my/own/server?U1=44
> Ive tried with this rule:
>   RewriteRule ^/my/own/server.+U1=44[^\0-9] http://xxx/inde.htm? [P,L]

> RewriteRule won't match on the query string, but you can use RewriteCond:
> RewriteCond %{QUERY_STRING} U1=44[^\0-9]
> RewriteRule ^/my/own/server http://xxx/inde.htm? [P,L]

Ok - One more problem though... I have two rules now:

RewriteCond %{QUERY_STRING} U1=44[^\0-9]
RewriteRule ^/my(.*) http://yyy/index.htm? [P,L]
RewriteRule ^/my(.*) http://xxx/index.htm? [R,L]

What I want is to get all request to /my/own/server?U1=44 proxied to yyy,
and all /my* redirected to xxx, but it seems it first matches the first
rule, then looks at the next rule and it matches that also so thats the rule
it uses. Is that assuption true, or? And how would i fix this? As I
understand it the RewriteCond only applys to the first rule right?

Best regards

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