I've got a rewrite like this:
RewriteRule /products.php?id=123&t=12345 /product/New-Product-Name
If I turn on RewriteLog
ging, and turn the level up, I get the following:
applying pattern '/products.php?id=123&t=12345' to uri '/products.php'
Why is the full uri (including querystring) not being looked at?
From the
mod_rewrite
docs:In short, you'll need to use a combination of
RewriteCond
andRewriteRule
; maybe something like:Update: I tested this, and it works as I described. It redirects to
/product/New-Product-Name?id=123&t=12345
.If you want the query string
?id=123&t=12345
to be removed, add a?
to theRewriteRule
, like:which will redirect to
/product/New-Product-Name
I'm imagining there's a better way to do this using
RewriteMap
, but this might do for a one-off.