Q:

URL redirect for a customer referral / rewards program with pretty urls and redirect

I am pretty new to Magento ... I just can't figure out what to search for I am developing a site with this very specific requirement...
I am setting up a customer referral program... there are a lot of extensions for that online. 
however, there is a trick to it...
most referral URL is like
www.foo.com/refercode=bar (or something close to it)
and then the system knows what to do...
in my case, it has to be set up in this way...
www.foo.com/bar
so now my question is how to redirect that bar to foo.com/customer/account/create/bar (or any other module to get the code and do the job) without it conflicting with the actual redirects that are being done for a mage to work normal....??? 
any comments would be appreciated or if there is a complete module or extension that will do that job 

A:

Using the method suggested by @kalenjordan I would use an htaccess rewrite:
RewriteRule ^/r/(.*)$ http://foo.com/customer/account/create/$1 [R=301,L]
This allows you to preserve your actual store's url without affiliates hijacking actual page names.  Force/lock them in to using /r/ as the prefix for the redirect handle.  I know this isn't ideal or an exact answer to your question but this is the preferred method for you to provide 'pretty' urls while still enabling affiliate marketing. 
You will still need to handle the params encoding in customer/account/create. 
To do that, you need to provide a rewrite in the following controller:
Mage_Customer_AccountController and rewrite the method public function createAction.  Rewriting controllers has some caveats, and you may prefer to do this with preDispatch observers.  Or, at least, that's my preferred method. 
More information on mod_rewrite:
http://httpd.apache.org/docs/current/mod/mod_rewrite.html

