php - Redirect url with parametes to new location using htaccess -


i want redirect domain.com/folder1/nisanth.php?id=1 domain.com/folder2/nisanth.php?id=1. how can write htaccess line? tried using

redirect 301 /folder1/nisanth.php?id=$1 /folder2/nisanth.php?id=$1 

but no use.

should be

redirect 301 /folder1/nisanth.php?id=(.*) http://www.domain.com/folder2/nisanth.php?id=$1 

Comments