An alternate method to this which 1) allows multiple file types and 2) works if you're trying to access a directory would be to put this in
.htaccess instead:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(([^/]+/+)*[^\.]+)$ $1.php? [QSA]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(([^/]+/+)*[^\.]+)$ $1.html
For example if you type in "http://yoursite.x10hosting.com/somepage" this will first look for "somepage.php" then "somepage.html". If neither is found it will look for the directory named "somepage".
You can add other file-types by simply copying the RewriteCond and RewriteRule lines and changing the extension to the one you want to use.
P.S. The
[QSA] (including brackets) tells the server to keep any arguments passed through the address bar, so pages such as "http://yoursite.x10hosting.com/somepage?someVar=27" will work properly. The arguments may be dropped off without it.

It must be supplied for any extensions that will use address line arguments.
P.S.S. This works on regular files
with the extension in the uploaded file. So leave the ".php" extension on your PHP files, just leave it out of the address. This is especially useful if the extensions you use in your site change, for example if you're upgrading to PHP from HTML but don't want to have to change all your links.