How do I set this type of subdomain in linode? foo.bar.com to bar.com/foo? Bar.com is via namecheap and is pointed at my linode.
Create a subdomain foo.bar.com via your control panel or do it manually on your Linode server. Then, set your DNS at Namecheap to point to your server IP when someone request foo.bar.com.
In the public_html of foo.bar.com on your Linode server, you can create an
Redirect 301 http://bar.com/foo