Janith Chinthana Janith Chinthana - 1 year ago 216
PHP Question

Set Dynamic Base Url in CodeIgniter

I need to set dynamic base url in codeigniter due to few following reasons.

  • localhost for development and reset when it goes live

  • single application accessible from multiple domains

  • ip address may change due to dhcp (locally)

Answer Source

CodeIgniter will figure out the base_url by itself, so you can just do:

$config['base_url'] = '';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download