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)
My first try was
RewriteRule ^(.*)\%3F(.*)$ $1?$2 [R=301, L]
to change %3F to ‘?‘ but it does not work. It is confusing what is real and what is en/decoded.
Thanks
It is not an elegant solution, but after months, it is the only way I found.
Regular case
is rewritten as
So, for requests like
I perform
This MUST be AFTER all directives that involves dir/file.php
Then I can handle the query string $_GET[‘qs’] in script.php
It may not apply to other situations that would enter into a loop or undesired results.