I want to change my site url structure from /index.php?qa=123&qa_1=why-do-birds-sing to /123/why-do-birds-sing (htaccess )
I have my site for a while and I don't want to have duplicate contents in search engine so all of /index.php?qa=123&qa_1=why-do-birds-sing must redirect to the new url with 301 code
How can I do it ?!
I tried this instead of default htaccess file but It is no working :(
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?qa=$1 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?qa=$1&qa_1=$2 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?qa=$1&qa_1=$2&qa_2=$3 [L]
</IfModule>