You could take a look at
http://www.inmotionhosting.com/suppo...t-via-htaccess which is almost exactly what you want.
As for your question that you PMed me (regarding fixing URL's in private messages), you can use the following query (add the table prefix if you use any):
HTML Code:
UPDATE pmtext SET message = REPLACE(message, 'olddomain.com', 'newdomain.com') WHERE message like '%olddomain.com%';