Suppose you have a website, www.mywebsite.com , running Joomla, version 1.5.5 or higher, with the following SEO Configuration: "friendly urls" feature enabled and "mod_rewrite" feature disabled.
Suppose that now, after some time and a long running history for your pages, you want to turn on the "mod_rewrite" feature, so that Joomla can remove the "index.php" string from all your urls. The problem is that both the new and the old urls are still valid and working at the same time, causing double indexing of the contents.
For an example, you have the following two urls for the same page, and you want the first one redirect to the second:
- www.mywebsite.com/index.php/search.html
- www.mywebsite.com/search.html
The solution is simple:
make an automatic 301 redirect from all the old urls to the new ones. You can do it simply putting the following two lines of code into your .htaccess file, after the "RewriteBase /" declaration:
# Redirect for pre-mod_rewrite urls
RedirectMatch 301 /index.php/(.*) http://www.mywebsite.com/$1
Obviously, remember replacing "www.mywebsite.com" with your website url.