Someone on stackoverview gave me this:
RewriteCond %{THE_REQUEST} \s/+index\.php\?q=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=302,L]
Put it above the first rewrite engine on line.
-
☆ A M B ☆
- 2,213 Posts
You might want to install MetaX which defines the canonical url. The search engines should update and respect that address without the need for the .htaccess code in question.
Thanks AMD,
MetaX sounds usefull. I did work out a quick way of doing that a few weeks ago. using: <link rel="canonical" href="[(site_url)][~[*id*]~]" />
But as always google is quite slow, and I wast sure if they would permanently remove the old urls.
-
☆ A M B ☆
- 2,213 Posts
Yes, they should update their index over time with the new addresses. Adding a sitemap and submitting it using Google Webmaster tools can also help.