Magento + htaccess + mod_rewrite: Forcing trailing slash & Force lower case URL
===

I am trying to make some changes to my htaccess file for my Magento store to force a trailing slash at the end of all URL's that are not a file AND are not .html (product pages). At the same time, I am trying to force all lower case in URL's as well. Both of these are for SEO reasons, as links to /category, /Category, and /category/ are all viewed as different pages by Google.

Here is the rewrite section of the .htaccess as it stands:

    <IfModule mod_rewrite.c>

    Options +FollowSymLinks
    RewriteEngine on

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

    RewriteRule .* index.php [L]

    </IfModule>


I was shown these two snippets, the first for forcing lower case, the second for trailing slash:

    RewriteMap  lc int:tolower
    RewriteCond %{REQUEST_URI} [A-Z]
    RewriteRule (.*) ${lc:$1} [R=301,L]

and...

    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]

However I don't know exactly how or where to insert these into the existing rewrites so everything works as desired.