The following is my directory structure
Root/
index.php
contact.php
projects.php
/index.php
/project1.php
/project2.php
I have rewrites in place to remove the .php extension from all file names. It works perfectly fine and I can access www.website.com/projects/project2.php
from www.website.com/projects/project2
I also want to be able to access www.website.com/projects/index.php
as www.website.com/projects
I have managed to write a rule which rewrites the url to www.website.com/projects/
when i type www.website.com/projects
However, I am not being able to get rid of the last trailing slash.
Please note that I do not really understand much of this. Most of it is from what I have found on the internet. I have looked around a lot but not got anything to work till now.
Here is the code:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^projects$ /projects/index.php [L,E=LOOP:1]