title: .htaccess Rewrite to Force Trailing Slash at the end
body: <p>I have the following code in my htaccess file:</p>
  
  <pre><code># Force Trailing Slash
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^[^/]+$ %{REQUEST_URI}/ [L,R=301]
  </code></pre>
  
  <p>That seems to work fine when I go to <strong>www.mydomain.com/test</strong> it redirects it to /test/.  The problem is when I go to <strong>www.mydomain.com/test/another</strong> it doesn't put the trailing slash on another.</p>
  
  <p>Does anyone know how to modify my code to make the trailing slash work no matter how long the URL is?</p>
  
  <p>Thanks!</p>