lucy24 - 8:22 pm on Oct 22, 2013 (gmt 0)
Please say that was a typo. You can only use mod_alias (Redirect by that name) if you don't use mod_rewrite at all. Not because the server will explode, but because there are likely to be unintended consequences. In Apache, you do not want unintended consequences.
Even within mod_alias, you would need to use the RedirectMatch format so you can use an end-anchored Regular Expression.
:: detour to refresh memory on mod_alias syntax, with pause for shudder at "(.*)\.gif" locution ::
RedirectMatch ^(.+/)?$ http://www.example.com/$1index.htm
But don't quote me. Does mod_alias use a leading slash in htaccess? I can't remember, and docs are uninformative. If yes, replace the above with ^(.*/)$ I've used a non-final .* or .+ because it's to be followed by only one character. But a [^.] would probably be better, since it gets rid of non-page requests a little sooner.
Redirect 301 ^/ http://www.example.com/directory/index.htm
:: heavy edit here because I tried to work out what the rule would do in real life, and just got a headache ::
If you have a large site with thousands of directory links, it can't possibly all be static, hand-rolled html. The names of linked directories come from somewhere, and it's the "somewhere" that needs to be changed globally. You are right that your internal links would also need to be changed, because search engines understandably don't much like internal links that consistently lead to a 301.
Besides, what happens if you ever change your extensions from .htm to something else? You'd still have to change all the directory links, or else do some gratuitous rewriting.