It seems a site is linking to mine in a bad way. From google webmaster tools I see some 404 errors
domain.com/file.php?id=1 (404) Not found (Date)
This url works ok but because of browser page decoding, the real (404) url is
domain.com/file.php%3Fid%3D1 (this is what my browser displays in the url input when I click on google url)
It is confusing what is real and what is en/decoded.
My first try was
[size=3]RewriteRule ^(.*)\%3F(.*)$ $1?$2 [R=301, L] [/size]
to change %3F to '?' but it does not work.
[size=3]RewriteCond %{QUERY_STRING} ^id\%3D(.+)
RewriteRule ^(.*)$ $1?id=%1 [R=301,L] [/size]
does change %3D to '=' for file.php?id%3D1
Thank you