In trying to find or figure out the answer for myself, I've RTFM (I own and have actually read the O'Reilly book), I've RTFApacheDocs, and I've trolled through the first hundred or so of the 500+ threads here on 301ís. I still need help.
Where I have the problem is that I don't understand the meanings of all the carets, parens, backslashes, brackets, braces, bangs and stuff. I finally found out the term (I think) is Regular Expressions, (took me days just to find that out because I missed it the first time through the docs). Fine. At Amazon I found a book that (foolishly) claims to be able to help me master them. But it won't be until after the holidays that I can afford a $30 book to help with one specific issue I have right now.
So, I'm asking for help here.
I need to change some directory and filenames, sending a 301 back to the UserAgent in case it's a robot (very important).
How do I say:
1) everything in old-directory is now in new-directory under the same filename.
2) For every file in this-directory (and in a separate example, in this-domain) with .htm or .html extension, use the same filename but with the .shtml extension.
3) Both rules together (old-directory/filename.htm and .html is now new-directory/filename.shtml)
There must be a far more efficient way to do this than endless hard-coded RedirectPermanent ...
Any suggestions? (Please operate under the assumption I'm completely clueless of all symbology beyond letters and numbers, because that would be very near to the truth.)
Eternal gratitude in advance.