Get base_url codeigniter?
===

I have two application for my project

 1. site.com
 2. api.site.com

And here's my config

$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/';

---

If i run **site.com**, how to get base_url or site_url of **api.site.com**? 

If i run **api.site.com**, how to get base_url or site_url of **site.com**?

Thank you