Am on 2.4.62 and fixed using the .htaccess code below:
# In order for the web server to process this file it must be renamed to ".htaccess"
Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [BCTLS,L,PT,UnsafeAllow3F]
</IfModule>
This configuration resolves the URL encoding issue by ensuring that %3F is properly passed to the rewritten query string without being double-encoded or treated as an unsafe character. It also maintains compatibility with PHP processing and prevents accidental rule conflicts.