lucy24 - 4:14 am on Apr 8, 2013 (gmt 0)
I thought your redirect involved the query string somewhere? If not, you can stay in mod_alias: Redirect(Match) by that name.
Forms like /widget_(.+).htm will work, but viewed purely as Regular Expressions they're pretty ghastly :)
#1 .* gives the possibility of zero content. Do you really have URLs in the form /widget_.htm and that's all?
#2 . is completely unconstrained. Since Regular Expressions are greedy by nature do not ask me why RegEx terminology all has to do with food that means your server first captures the request all the way to the end, and then has to backtrack until it's got a ".htm" left over.
#3 that same . shows up once more. It means "any character" so ".htm" doesn't only mean ".htm" but also "_htm" and "2htm" and "xhtm" and... well, you get the idea. In combination with the .* it adds an extra delay, because the server is now looking for "any old character followed by h" -- whoops! no, it's "any old character followed by ht" and so on. Express it as \. and you can cut to the chase.
And, since your URLs presumably don't contain any extraneous periods-- unlike, say, ahem, apache dot org which often has a literal . in mid-URL --you can replace the package with ([^.]+)\.htm
Finally, is that / the beginning of your path or does it come along later? Use an opening anchor ^ and your server can be out of there all the sooner "oops! doesn't begin with 'widget' so I'll stop looking right now".
Parsing html as php kinda defeats the point of having different extensions. On the actual files, not the URLs. Note that parsing X as Y is an entirely different process from rewriting an URL in X to a file in Y.
Someone else will give the lecture about pretty URLs and not-so-pretty URLs.