Based on htaccess 301 redirect - Remove query string (QSA)
RewriteCond %{QUERY_STRING} ^(hash)=([^-\/]{32})$
RewriteRule . %{REQUEST_URI}? [E=HASH:%2,R=301,L]
In the below case ENV:HASH is not redirected.
How to store the query string content as an environment variable before removing it from the url?