The following is the directory structure
Root/ index.php contact.php projects.php /index.php /project1.php /project2.php
I have rewrites to remove the .php extension from all file names. It works great and I can access www.website.com/projects/project2.php from www.website.com/projects/project2
I also want to have access to www.website.com/projects/index.php as www.website.com/projects
I was able to write a rule that rewrites the url to www.website.com/projects/ when I type www.website.com/projects
However, I cannot get rid of the last trailing slash.
Please note that I do not really understand this. Most of this from what I found on the Internet. I looked around a lot, but still have not received anything to work.
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]
ghosh source share