Forum Moderators: phranque
RewriteRule ^(.*)-file\.html$ realone.php?key=$1&{query_string}
So that
domain.com/widget-file.html?a=1&b=2
would rewrite to
domain.com/realone.php?key=widget&a=1&b=2
Is the only way to use the rewriteCond to capture the query string first and then have at least two rewrites for the same url (one with a query string, one without)?
thanks
Try this instead:
RewriteRule ^([^-]*)-file\.html$ realone.php?key=$1?%{QUERY_STRING}
Ref: Introduction to mod_rewrite [webmasterworld.com]
HTH,
Jim
There was already a? at the beginning of the querystring before the first parameter (key=$1) which is why I had the & before %{QUERY_STRING}.