Search Engine Questions

I have the following code in my .htaccess file, to get rid of the file extension .php in the url:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

Right now, I have pages in the search engine show up with both the .php and without. How can I make sure it will show up without?
Also, I have two more problems.

  1. How can I make sure the search engines only diplay my site without the www?
  2. How can I make sure the search engines display http://mysite.com instead of http://mysite.com/index or http://mysite.com/index.php

Thanks for any advice!
I’m sort of a newbie at SEO.
Just in case you need to know, the site is Apache on Unix.

To get rid of the www ;

# -301 Redirect (www)-

RewriteEngine on
RewriteCond %{http_host} ^www\\.mysite\\.com [nc]
RewriteRule ^(.*)$ http://mysite.com/$1 [r=301,nc]

Not sure how to do the other thing using .htaccess but maybe just make sure that none of your links point directly to index files, instead have them consistently point to the directories. As long as you do that, there’s no reason why the search engine should know about the “index.php” URLs.