Is it possible to write a rule that will add a slash to a URL that someone enters?

My website is setup like this:


If someone enters www.domain.com/folder the page will not load.
www.domain.com/folder/ the page loads correctly.

There is an index file in each folder.

I have tried this but it does not work.

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