title: Removing The Trailing Slash from a directory in htaccess
body: <p>The following is my directory structure</p>
  
  <pre><code>Root/
      index.php
      contact.php
      projects.php
                  /index.php
                  /project1.php
                  /project2.php
  </code></pre>
  
  <p>I have rewrites in place to remove the .php extension from all file names. It works perfectly fine and I can access <code>www.website.com/projects/project2.php</code> from <code>www.website.com/projects/project2</code></p>
  
  <p>I also want to be able to access <code>www.website.com/projects/index.php</code> as <code>www.website.com/projects</code></p>
  
  <p>I have managed to write a rule which rewrites the url to <code>www.website.com/projects/</code> when i type <code>www.website.com/projects</code></p>
  
  <p>However, I am not being able to get rid of the last trailing slash.</p>
  
  <p>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.</p>
  
  <p>Here is the code:</p>
  
  <pre><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]
  </code></pre>