I want to 301 redirect with .htaccess. i used following code. RewriteEngine On RewriteRule ^main/index.php?Action=ABC.XYZ /newfolder/main/index.php?Action=ABC.MNQ [R=301,L] RewriteRule ^oldfolder/ /abc/newfolder/ [R=301,L] the 2nd redirection is working fine. but first one not working.