By using this rule inside a virtual host configuration file results in double getting away from the query parameters:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

For instance:

http://example.com?f=hello%20world

Results in

https://example.com?f=hello%2520world

Note the "%25" getting away the "%" sign. Why happening ?

Consider adding the [NE] tag in the finish from the rewrite rule (NoEscape).

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]

This occurs because &lifier et ? plus some other medication is steered clear of automatically within the rewrite process.