title: remove last slash or forward slash in htaccess
body: <p>other domain </p>
  
  <pre><code>http://domain.com/name/directory/brand/ &lt;&lt;&lt; this last slash
  http://domain.com/name/directory/check/me/ &lt;&lt;&lt; this last slash
  </code></pre>
  
  <p>main page</p>
  
  <pre><code>http://doamin.com/name/directory/index.php
  </code></pre>
  
  <p>my intention is whatever url the person enter , it will always redirect to them to the main page and i also want to remove the last slash or forward slash at the last of the url , not matter what url they enter , i dont want to contain last slash.</p>
  
  <p>i did get the them to redirect to main , but i cant get the url remove.</p>
  
  <p>this is my code</p>
  
  <pre><code>RewriteEngine on
  
  # Don't rewrite files or directories
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} /(.*)/$
  RewriteRule ^ /%1 [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ /name/directory/index.php [QSA,L]
  </code></pre>
  
  <p>thank you</p>