I have a web site that has the file extension of .php. As of right now I have it setup to rewrite that server side using .htaccess to drop the .php from the file name making it example.com/filename, I also have it set to redirect/filename to /filename/. I now want to make it redirect /filename.php to /filename/. How can I do this?
What I have now is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(([^/]+/)*[^./]+)/$ /$1.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
</IfModule>