Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
335 views
in Q2A Core by
edited by

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>

 

 

Q2A version: 1.6.2
by
Does not installing redirect between URL structures really lead to duplicate content? I have posted a separate question about this: http://question2answer.org/qa/33538/installing-redirect-between-structures-duplicate-content

Please log in or register to answer this question.

...