httpd-users mailing list archives

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

On Wed, 30 Jun 2004 15:25:01 +0200, Søren Neigaard
<s.neigaard@mobilethink.dk> 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
Søren



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