I found that this works...
RewriteRule ^(.+)\.html?$ /$1.php [R=301,NC]
RewriteRule ^SUB1/(.+)$ /$1 [R=301,NC]
This did not...
RewriteRule ^(.+)\.html?$ /$1.php [R=301,NC]
RewriteRule ^SUB1/(.+)$ http://example.com/$1 [R=301,NC]
Since the patterns are identical, there's something you're not telling us. Note that I've added a space to stress that each version is two rules, and only the second rule of each pair is different. There
are times when a RewriteRule will interpret the pattern differently depending on whether there's a protocol-plus-domain in the target. But that shouldn't apply when you've got an explicit [R] flag.
You don't need the [NC] flag unless your old site genuinely used all possible permutations of html, HTML, Html, hTmL and so on. For the human writer, [NC] is just a couple of letters. But for the server, it converts the whole thing into
\.[Hh][Tt][Mm][Ll]
regarding the parsing as php issue, why don't you just set the server to process .htm and .html as php? would save a rewrite?
There's that, too. But this is only practical if all files in a given directory are to be parsed as php. Otherwise the server is doing a lot of needless work. Kinda the same thing as parsing .html for SSIs in this respect.
Some people at this point would put in a strong argument for going extensionless.
Now then... the pattern
(.+)\.html
is not as efficient as it could be. (I think g1smd had a fixed phrase involving "greedy and promiscuous", like that one nephew everyone has.) There are alternatives; the easiest is
^([^.]+)\.htm
if your file and directory names never contain literal periods.
Unless you've got some very weird naming, you don't need a closing anchor, and therefore don't need the l? at the end: just let the server match as far as "htm" and it can get out of there. Since you're issuing an external redirect, it wouldn't even matter if there were extraneous garbage after the "htm" or "html".
http://example.com/SUB1/index.htm
needs to be...
http://example.com/index.php
and
http://example.com/SUB1/Sub2/index.htm
needs to be...
http://example.com/Sub2/index.php
Uhm, no, they don't. They need to be
http://example.com/
and
http://example.com/sub2/
without explicit "index.anything", where both are expressed as the single conditionless rule
RewriteRule ^sub1/(\w+/)?index\.htm http://example.com/$1 [R=301,L]
Normally an index redirect is your second-to-last redirect; here it should come
before the generic rule
RewriteRule ^sub1/(.*) http://example.com/$1 [R=301,L]