Home .htaccess doesn't escape question mark on RewriteRule
 I have a website with an old type of Single Sign On. A parent website sends users to my website with a URL like: http://test.instela.fm/index.php?gid=abcd1234&u=thedewil&id=11472 and I want to rewrite it as this: http://test.instela.fm/login/abcd1234/thedewil/11472 I have created a .htaccess file as following: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^index.php?gid=(.*)&u=(.*)&id=(.*)$login/$1/$2/$3 [L]  I tried escaping the question mark in the URL as this: RewriteRule ^index.php\?gid=(.*)&u=(.*)&id=(.*)$login/$1/$2/$3 [L]  But, unfortunately both these rules don't match and rewrite the URL, which I can't understand why.