lucy24 - 11:36 pm on Mar 26, 2013 (gmt 0)
you might want to use a <Directory> container.
When the first post contains the word "htaccess", I normally assume the asker is on shared hosting and therefore can't use <Directory> or <Location>.
If one filename is contained within another, like "index.php" within ".php", separate <Files> envelopes are probably not the way to go.
For several years I had a generic RewriteRule that said simply
RewriteRule \.php - [F,NS]
Later I had to add Conditions to exempt some specific filenames. The [NS] flag means the rule won't apply to SSIs, or to any mod_dir activity (including auto-indexing). It does not cover the results of RewriteRules,* so you have to exempt those by name.
RewriteRule ^paintings/(spare[cr]at)s/(\w+)\.html /paintings/$1s/$1links.php?page=$2 [L]
if anyone wondered. (I'm working with existing naming patterns.)