Re: unable to capture GET parameters with mod_rewrite rule

Giganews Newsgroups
Subject: Re: unable to capture GET parameters with mod_rewrite rule
Posted by:  D. Stussy (spam+newsgroups@bde-arc.ampr.org)
Date: Thu, 22 Jul 2010

"yawnmoth" <terra10…@yahoo.com> wrote in message
news:2fbe2269-16a0-4e1d-9324-3b59b5ef31…@5g2000yqz.googlegroups.com...
> RewriteRule ([0-9]+)/index\.php\?var=(.+) /path/to/test.php?a=$1&b=$2
>
> That doesn't work.  It redirects to /path/to/test.php only so long as
> there's nothing after the \.php part.  ie. it's as though the ?
> character, escaped though it is, is breaking it.
>
> RewriteCond %{QUERY_STRING} var=(.+)
> RewriteRule ([0-9]+)/index\.php /path/to/test.php?a=$1&b=$2
>
> That doesn't work either.  It seems I can capture in RewriteCond but I
> can't use what I captured anywhere else it seems.
>
> Any ideas?

RewriteRule ([0-9]+)/index\.php /path/to/test.php?a=$1 [QSA]

Replies

None

In response to

unable to capture GET parameters with mod_rewrite rule posted by yawnmoth on Wed, 21 Jul 2010