I'm on a Unix server with Joomla 1.5.x and I use Artio Joomsef to get my SEO URL's.
In Google I can find the following links:
http://www.example.com/index.php
http://www.example.com/index.php?P=g&Pnr=6
http://www.example.com/index.php?P=g&Pnr=9
We don't use index.php?<something> links anymore, so I want to point them to http://www.example.com. Next to that I would like to make sure http://www.example.com/index.php points to www.example.com as well, to prevent the same content on 2 different pages.
In tried the following:
RewriteRule ^index\.php$ http://www.example.com/ [R=301,L]
Which works.
But then the http://www.example.com/index.php?P=g&Pnr=6 url gets redirected to http://www.example.com/?P=g&Pnr=6
So I could create a redirect just for the "?P=g&Pnr=6" string. But I "can't" do that...
Because of dodgy .htaccess coding in the past the above solution would mean that I would have to rewrite a lot of old RewriteRule's.
So is there a way to rewrite index.php but to also rewrite index.php?P=g&Pnr=6 or index.php?P=ab or /us/index.php?P=n&A=10 ?
**EDIT**
One way to solve the problem is to put the line:
RewriteRule ^index\.php$ http://www.example.com/ [R=301,L]
All the way at the bottom of the .htaccess file so it rewrites my index.php?P=a rules first. This is seems a bit backward to me...