I've got a problem with an old site (running EE2.4) which is issuing a 404 if the URL contains a querystring. This is happening on the homepage only.
i.e.
http://www.example.com/?foo=bar causes a 404
http://www.example.com?foo=bar causes a 404
http://www.example.com/abc/?foo=bar is fine
http://www.example.com/abc?foo=bar is fine
Index.php is being removed from the URLs using the following htaccess
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
I have also tried adding the QSA paramater to the rewrite with no luck.
If I visit http://www.example.com/index.php then the homepage loads but as soon as I append a querystring it's back to the 404 page.
I have also tried setting the URI protocol to force querystrings but it still doesn't work (and adds ? characters within the URL of other pages).
It might also be pertinent to mention that this site is using Structure. I have tried turning off the "append trailing slash" feature therein.
Strict URLs is also turned on. But turning it off doesn't help.
The only way I can get this to work is to set the 404 page to be the homepage template. Then it works but obviously means that nonsense URLs will resolve to the homepage - which is undesirable.