If you post how you want your variables to be passed I'm sure someone here can give you examples of how best to set up your htaccess.
I know I can offer simple solutions, but advice from a few people would probably be best... unless it's from cd34, then you can probably just ignore everyone else.
Also, I can't say the SE benefits are better, but I prefer this:
hostname.com/
affiliatecode/whatever/
over this:
affiliatecode.hostname.com/whatever/
Just as cd34 first suggested. It should be easier to set up that way too.
