Rewriting an additional query string using mod_rewrite

I hope to learn how to do regular expressions regularly, but right now I need a little help.

I have it installed in my .htaccess. So that the request to example.doc is internally redirected to the download.php file? File = example.doc

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

I need it to change a bit, so adding an extra request (always present) in the document is also internally rewritten and passed to php. For example: request example.doc? Verify = to rewrite download.php internally? File = example.doc & verify = whatever

Thank! Neddit

+2
source share
1 answer

The [QSA] flag should take care of this (add a query string).

+3
source

Source: https://habr.com/ru/post/1791267/


All Articles