I need a rule that will add an .html extension whenever there is 'not' a trailing slash if this is possible.
I have a new client that has changed ecommerce scripts and, the new version handles SEO differently and changed all of their 16,000+ product links. This was not caught prior to the site being re-indexed so it's now a big problem and I need a little help with this.
All of their products used to have links like this
domain.com/category/productname
but are now
domain.com/category/productname.html
Category links did not change and all are like this
domain.com/category/ (with trailing slash)
I tried a variety of things but couldn't figure out how to limit the redirect only to links without a trailing slash. I then found an old thread here and the bottom replies seemed to be exactly what I'm needing but are not working.
[
webmasterworld.com...]
These are the most promising methods I have tried
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) /$1.html [L]
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule ^([^.]*[^./])$ $1.html [L]
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule ^([^./]+)$ $1.html [L]
Existing rules from cart script
RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]
Thanks for helping if you can