My directory structure is
- Assets
- Dashboard
- index.php
- account.php
index.php
about.php
verify.php
What I basically want it to be:
- Remove the .php extension for example
http://example.org/about.php
should behttp://example.org/about/
(including the trailing slash as well) - If
.php
is encountered in the URL redirect it back tohttp://example.org/about/
The relevant portions of my .htaccess file looks like this
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)$ $1.php [L]
I'm running it on localhost XAMPP web server.
The works fine but when it encounters the trailing slash it gives me a 404.