Welcome Guest, Not a member yet? Register   Sign In
config['base_url'] for access from public & private network


I have an CI-based app that runs on a private IP space (192.168.*.*). This app can also be accessed from the internet (via a hole in the firewall).

My question is: What is the best way to set the config['base_url'] for this app? If I set it to the private IP, obviously it can't be accessed from the internet. If I set it to a public IP, the internal PCs would have to go outside the firewall then come back in. What do you recommend?


To do this you need to remove the protocol and host name from config['base_url'].
If you have:

config['base_url'] = 'http://hostname/application';

use the following:

config['base_url'] = '/application';

[eluser]Phil Sturgeon[/eluser]
The other popular favourite is to use:

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

attos's approach will be easier if you use a port other than port 80.

Brilliant!!! Thanks.

Theme © iAndrew 2016 - Forum software by © MyBB