title: How to access directory's index.php without a trailing slash AND not get 301 redirect
body: <p>I have this structure: <code>site.com/api/index.php</code>. When I send data to <code>site.com/api/</code> there is no issue, but I imagine it would be better if the api would work without the trailing slash also, like this: <code>site.com/api</code>. This causes a 301 redirect and thus loses the data (since data isn't forwarded). I tried every re-write I could think of and couldn't avoid the redirect. This is my current re-write rule (though it may be irrelevant).</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^api/(.*)$ api/index.php [L]
  </code></pre>
  
  <p>Can I make this url work and maintain the post data without using the trailing slash?</p>
  
  <p>Some rewrites that didn't work: (all still redirect)</p>
  
  <pre><code>RewriteRule ^api$ api/index.php [L] 
  RewriteRule ^api/*$ api/index.php [L]
  </code></pre>