Basically what I am trying to do is remove the file extensions from my page URLs.

I'm hosting through 1and1, using Web Files (which like a directory structure I can drop files into and create folders). Windows Platform.

I have created an .htaccess file and put it in my root directory.

The entire contents of my file are below:

Options -MultiViews
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

Order deny,allow
ErrorDocument 404 /404.php
DirectoryIndex default.php

The first group of code is supposed to remove the .php extension from my URLs. i.e.

The second group of code is supposed to add a trailing slash to my URLs. i.e.

The third allows me to use a custom 404 page (which is called 404.php and is in my root directory) as well as making default.php my index page. For some reason if I have default.html it gets picked up as the index page automatically whereas default.php doesnt (after removing default.html).

My files are there (for example currentprojects.php is in the root) and work if you add the .php on the end i.e.

Without the .php on the end I get a 404 error if the file doesn't have a directory by the same name (minus the .php) or a 403 access denied if it does.

I have tried about 10 different versions of the above code. I know my file is being read as the 404 page works.

If you can help me resolve this it would be awesome!