You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Michael Smith <mj...@iii.co.uk> on 1998/01/28 14:03:54 UTC

mod_rewrite on QUERY_STRINGs ??

I'm not sure from the documentation of mod_rewrite whether I ought to be
able to use it on QUERY_STRINGs or not.  I would like to rewrite
something like

http://www.foo.com/path?action=blob&detail=bar

to

http://www.foo.com/path2/cgi?action=bar

I have tried several variants of

RewriteRule path?action=blob&action=(.*)

But the "RewriteLog" suggests that the QUERY_STRING is ignored for
RewriteRules.

I can use RewriteCond to test that the QUERY_STRING is of the required
type, but I don't seem to be able to do the mapping based upon the part
of it I am interested in.

Is it possible to do the kind of rewrite I am thinking of here (I've got
version 3.0), ie using the contents of QUERY_STRING to determine the
rule?

Cheers

Mike



Re: mod_rewrite on QUERY_STRINGs ??

Posted by Michael Smith <mj...@iii.co.uk>.
Michael Smith wrote:

> I'm not sure from the documentation of mod_rewrite whether I ought to be
> able to use it on QUERY_STRINGs or not.  I would like to rewrite
> something like
>
> http://www.foo.com/path?action=blob&detail=bar
>
> to
>
> http://www.foo.com/path2/cgi?action=bar
>
>

Under apache 1.3 RewriteCond backreferences can be used to do this; I'm
guessing that it's not possible under 1.2.

Mike