I want to redirect index.php?action=this&id=1 to index.php?action=this&id=2
I tried the code below in my .htaccess but it didn’t help
redirect 301 index.php?action=this&id=1 http://mysite.com/index.php?action=this&id=2
What am i doing wrong here? what could be a workaround?
In order to match specific query string you have to use mod_rewrite. Please check if it is installed/allowed on your host. The rule in this case will be something like this:
This needs to be placed in .htaccess in website root folder. If placed anywhere else some small changes may be required.
This rule will only redirect
/index.php?action=this&id=1to/index.php?action=this&id=2and no other URLs (just as you asked in your question).