.... nice addition that has tripped me up many times before.
I’ve been completely stumped wondering why my app wasn’t working properly
only to find it was 17 little characters destroying my life: http://localhost/
I posted a ‘mini article’ in another topic, about same issue:
In a bit shorter version:
Many many many many softwares have not an intelligent way of setting BASE-URL.
I make 99% of my PHP work and applications admin from http://localhost/
Now, if I set base-url in a software (sometimes even in the database!)
like this: http://localhost/app/
then nobody else but me can use my app.
If I set base-url like this: http://www.mydomain.com/app/
then I can not admin my apps (unless I connect via some proxy server)
This is how I have set config of my CodeIgniter ( and a whole bunch of other less intelligent softwares )
//| URL to your CodeIgniter root. WITH a trailing slash:
$config['base_url'] = "http://".$_SERVER['HTTP_HOST']."/codeigniter/";
Adding a couple of more lines, it is even possible to detect if it should be either of:
https:// http:// ... and the phpBB3 developers even auto detect whatever :8080 port number!
This way it will work whatever URL alias is used to visit your site!
yourdomain.com, localhost, 127.0.0.1, 192.168.0.1 etc etc
And if you change your domain name, you wont have to change a thing.
Regards - phpMaster