.htaccess 301 Redirect non slash domains and slash domain to .html

[size=4]I am trying to add some code to my .htaccess to redirect all [/size]slash and non slash urls ( apart from my homepage ) to the .html url.



[size=4]For example [/size]

[size=4]www.mydomain.com/cat/ [/size]

[size=4]www.mydomain.com/cat [/size]



[size=4]should redirect to [/size]



[size=4]www.mydomain.com/cat.html[/size]



[size=4]I have managed to add the following to my .htaccess which redirects www.mydomain.com/cat to the right place www.mydomain.com/cat.html but need some help on how to make slash version redirect to the .html page[/size]


RewriteCond %{REQUEST_URI} !\.[^./]+$<br />
RewriteCond %{REQUEST_URI} !(.*)/$<br />
RewriteRule ^(.*)$ [url="http://mydomain.com/$1.html"]http://mydomain.com/$1.html[/url] [R=301,L]
```<br />
<br />
<br />
[size=4]My whole .htaccess looks like this, if anyone has any suggestions on how it should look in light of the above it would be greatly appreciated.[/size]<br />
<br />
```php
Options +FollowSymlinks<br />
RewriteEngine on<br />
RewriteCond %{HTTP_HOST} ^xxx.xxx.xxx.xx [nc,or]<br />
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]<br />
RewriteRule ^(.*)$ [url="http://www.mydomain.com/$1"]http://www.mydomain.com/$1[/url] [L,R=301]<br />
<br />
RewriteCond %{THE_REQUEST} ^.*/index.php<br />
RewriteRule ^(.*)index.php$ /$1 [R=301,L]<br />
<br />
<br />
RewriteCond %{REQUEST_URI} !\.[^./]+$<br />
RewriteCond %{REQUEST_URI} !(.*)/$<br />
RewriteRule ^(.*)$ [url="http://mydomain.com/$1.html"]http://mydomain.com/$1.html[/url] [R=301,L]<br />
<br />
<br />
DirectoryIndex index.html index.php<br />
<br />
<IfModule mod_rewrite.c><br />
RewriteEngine on<br />
# Pleas note that RewriteBase setting is obsolete use it only in case you experience  some problems with SEO addon.<br />
# Some hostings require RewriteBase to be uncommented<br />
# Example:<br />
# Your store url is [url="http://www.yourcompany.com/store/cart"]http://www.yourcompany.com/store/cart[/url]<br />
# So "RewriteBase" should be:<br />
# RewriteBase /store/cart<br />
# RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . index.php?sef_rewrite=1 [L,QSA]<br />
<br />
</IfModule>
```<br />
<br />
[size=4]Many thanks in advance.[/size]