301 redirect issue
.htaccess redirects should take effect before the php page is even called. If you want to rule out CMSB what you can do is create a static HTML page such as:
And figure out how to get that to redirect. If it still doesn't work check out these google links: https://www.google.com/search?q=htaccess+redirect+page+with+query+string
Hope that helps!