Redirecting a visitor who hits http://example.com to http://www.example.com isn't terribly difficult. But how is it done in conjunction with a RewriteRule that directs all page requests through "index.php"?
RewriteRule !\.(gif|jpg|png|css|js|php|ico|xml)$ /index.php