I have a static website running in conjunction with wordpress in the same dir, it all works fine. However, on the static pages that don't use wordpress I cannot seem to remove the .php file extensions my .htaccess file looks like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
ErrorDocument 404 /index2.php
RewriteEngine On
RewriteBase /index.php/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
#Alternate default index page
DirectoryIndex index2.php
ErrorDocument 404 http://example.com/index2.php
I have tried adding this code as you usually would but it wont work:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Try this
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]