lucy24 - 11:28 am on Jan 10, 2012 (gmt 0)
Urk. If you can't make the server cut it out-- it sounds like mod_negotiation running amok-- I guess you are stuck with a rewrite. But it will be easier on your server if you say
RewriteRule ([^.]+\.htm). http://example.com/$1 [R=301,L]
(The dot after the parentheses is not a flyspeck.)
Nothing before the permitted .htm will contain a period, so that is the simplest way to constrain the search and still have the function stop in the right place. Otherwise it will have to keep backtracking until it finds the .htm in the middle.
No need for an opening anchor, because the search starts at the beginning by default and you're capturing everything you see. May as well include the .htm in the capture, since you're there anyway. Saves typing.
On the other hand you don't need to capture the part after .htm; you just need to ensure that there is at least one more character. Incidentally that will be enough to redirect any stray .html that sneaked in.
Now go see if you can talk sense into your server ;)