g1smd - 8:27 pm on Feb 22, 2013 (gmt 0)
The code you supplied redirects non-www to www but fails to redirect many of the other non-canonical versions.
Say in plain English what you want to happen.
I assume you want URL requests for example.com/index.php on any hostname to be redirected to the URL www.example.com/
I assume you want all internal pages requested on anything other than www.example.com to be redirected to the same page on www.example.com
I assume you want requests for the URL www.example.com/ to be fulfilled by the /index.php file, without revealing the name of that internal file.
Please confirm the above and fill in the rest of the gaps.
The rule you supplied will need to be improved and one or more other rules will need to be added.