I used to have a query string for handling mobile pages. Now the site is responsive it doesn't need it and I need to do 301 redirects let google know.
so
http://www.example.com/aaa/bbb?fromMobile=true should become http://www.example.com/aaa/bbb
and
http://www.example.com/aaa?fromMobile=true should become http://www.example.com/bbb
and
http://www.example.com?fromMobile=true should become http://www.example.com
etc
I have:
RewriteCond %{QUERY_STRING} ^(?)fromMobile=true$ [NC]
RewriteRule (.*) /$1?%1&%2 [R=301,L]
But this redirects:
http://www.example.com?fromMobile=true to http://www.example.com?
How can I get rid of the trailing question mark? I've tried a bunch of things without joy.