If I do a header("Location: http://xyz.com") does that get sent to the browser immediately? In other words, can I then do other stuff after the header command without worrying about delaying the redirect to the browser? Thx.
You have to do what you have to do before the header Location thing or, you can use meta refresh with a small delay.
This is not about how to better redirect. the guy wants a redirect and some code executed. How do you do that with .htaccess?
htaccess is not always the best choice. In forums like phpBB the header function is used because they first need to check if for example a user is logged in or not. Then it's so much easier to use the header function.
You can only modify the header before any output is sent to the browser. Else you'll need to use the META refresh.
Alternatively, if you don't want to worry about outputting something before calling header(), use output buffering.