Your last post seems to be working perfectly for cases where a spurious question mark occurs after or in the middle of an otherwise legitimate filepath.
For exmaple, it works perfectly for:
But I am having problems getting the question mark removed when it occurs at the beginning of the filename as in:
In this case, it redirects to the homepage.
Do you have any suggestions? I have been spending some time trying to learn this, and searching around. My fear is adding code to strip that question mark, and messing up the portion of your code that is working perfectly.
Also, I want to verify that I have placed this code in the proper order relative to other rules. I have placed it at the end of all canonical redirects, non-www to www, etc.
This is such a huge undertaking for me, but I have learned a lot :)
I appreciate your help.