Using this rule in a virtual host configuration file leads to double escaping of the query parameters:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*)
Try to add the [NE] (noescape) tag at the end of the rewrite rule:
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
This happens because & and ? and some others are escaped by default in the rewrite process.
&
?