I currently have these two pieces to my website.
localhost/FTS/papers - which is a php file
localhost/FTS/papers/ - which is a directory
What I am wanting to do is make it so that when I load:
localhost/FTS/papers -or-
localhost/FTS/papers/ -or-
localhost/FTS/papers.php
I want them all to go to the papers file.
Right now it is accessing the directory instead of the file which is not what I want.
Place this rule in your DOCUMENT_ROOT/.htaccess file:
RewriteEngine On
RewriteBase /FTS/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/FTS/$1.php -f
RewriteRule ^(.+?)/?$ $1.php [L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With