I need some help with a mod rewrite.

I have a web application up and running on a subdomain (http://foo.bar.com)

I want to be able to access this application from a directory on the root domain. (http://www.bar.com/foo).

I see how you can do the reverse of this, but I can't get it to work. I don't want to redirect it, I want the site (http://foo.bar.com) to be accessible through both domains.

How can I get this done with mod_rewrite?