Test server is behind a router at my house, when trying to access it from outside my home network URL redirected to a 192.168.x.x IP

Permalink
Hello!

I'm brand new to C5 but an excited to learn about it. I have properly setup a development server at my house that sits on my home network, IP 192.168.1.103. I have my router set to forward all http traffic (port 80) to this IP address. When I try to hit concrete5 from my outside my home network using my ISP provided IP address the URL gets redirected to 192.168.1.103 which obviously won't work when Im not on my home network. Is there a way around this?

Thanks!

 
mdzoidberg replied on at Permalink Best Answer Reply
mdzoidberg
Hi,

On your config folder, the file site.php change the line that reads;

define('BASE_URL','');

to
define('BASE_URL','http://'.$_SERVER["HTTP_HOST"]);


that way you will always be able to access locally and remotely.

Cheers.
bucketsofbits replied on at Permalink Reply
Thanks! Worked like a charm.
mdzoidberg replied on at Permalink Reply
mdzoidberg
Glad it worked!, welcome to C5 :)
Mnkras replied on at Permalink Reply
Mnkras
zoid, just a tiny thing, you can actually comment out both the BASE_URL and DIR_REL, and it will pull from the base.php which has a similar piece of code
mdzoidberg replied on at Permalink Reply
mdzoidberg
Cool, I didn't know that :), thanks Mnkras