Neddy
Neddy

Reputation: 503

rewriting an extra query string with mod_rewrite

I hope to learn how to do regular expressions one day but for now I need a little help.

I have this set up in my .htaccess. So that a query to example.doc is internally forwarded to download.php?file=example.doc

RewriteRule ^(download.php.*) - [L]         
RewriteRule ^(.+\.(doc|docx))$ download.php?file=$1

I need it changed slightly so that an extra query sting (always present) on the document is also internally rewritten and passed to the php. For example: a query to example.doc?verify=whatever would be internally rewritten to download.php?file=example.doc&verify=whatever

Thanks! Neddy

Upvotes: 2

Views: 133

Answers (1)

pritaeas
pritaeas

Reputation: 2093

The [QSA] flag should take care of this (Query String Append).

Upvotes: 3

Related Questions