title: htaccess simplified and remove need for trailing a slash
body: <p>I am writing my very first htaccess and would like help cleaning it up and understanding it. The first issue I am having is with mulitple parameters. my current setup looks like:</p>
  
  <pre><code>Options +FollowSymLinks
  
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !/(_modules|css|files|ico|img|js)/
  RewriteRule ^([^/]*)$ index.php?p1=$1 [L]
  
  RewriteCond %{REQUEST_FILENAME} !/(_modules|css|files|ico|img|js)/
  RewriteRule ^([^/]*)/([^/]*)$ index.php?p1=$1&amp;p2=$2 [L]
  
  RewriteCond %{REQUEST_FILENAME} !/(_modules|css|files|ico|img|js)/
  RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ index.php?p1=$1&amp;p2=$2&amp;p3=$3 [L]
  
  RewriteCond %{REQUEST_FILENAME} !/(_modules|css|files|ico|img|js)/
  RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ index.php?p1=$1&amp;p2=$2&amp;p3=$3&amp;p4=$4 [L]
  </code></pre>
  
  <p>Is there a way to simplify this to handle up to a maximum of 4 parameters with all of them being optional? Which leads me to me next problem that it seems that if you need to have a trailing slash after the parameters unless you are using all 4 parameters.</p>
  
  <p>In short I would like my urls to look like this...</p>
  
  <pre><code>http://www.example.com/home
  http://www.example.com/home/
  http://www.example.com/blog/i-am-a-title
  http://www.example.com/blog/i-am-a-title/
  http://www.example.com/varable1/varable2/varable3/varable4
  http://www.example.com/varable1/varable2/varable3/varable4/
  </code></pre>
  
  <p>I'll appreciate any help that you can provide.</p>