CodeIgniter Forums
base_url == http://[::1] - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: base_url == http://[::1] (/showthread.php?tid=64542)



base_url == http://[::1] - ma5t3r - 03-02-2016

Hi,
I have a problem since I remove the index.php in the URL of my codeigniter project with .htaccess.
In my config file : 
Code:
$config['base_url'] = '';
$config['index_page'] = '';
Now, when I want to call the base_url function ( 'blah') of codeigniter, it shows me :

http://::1/blah

all my references are broken.

nothing works  Angry

Thanks a lot for a solution


RE: base_url == http://[::1] - kilishan - 03-02-2016

You should set the value of 'base_url' to the hostname of the site you're working on. Leaving it blank will cause these errors as it attempts to find the host, but can't always on localhost.


RE: base_url == http://[::1] - ma5t3r - 03-02-2016

In my previous projects, i'd never set it up this base_url variable.
I don't know why, now, for this new project, i have troubles.

It mean i must have a config file for the server and one for localhost

Thanks for reply.


PS: Soz for my English. I'm french


RE: base_url == http://[::1] - jlp - 03-02-2016

This was a change in CI3.0.3, described on the "upgrading" page:
http://www.codeigniter.com/user_guide/installation/upgrade_303.html?highlight=base_url


RE: base_url == http://[::1] - siburny - 03-02-2016

(03-02-2016, 10:59 AM)ma5t3r Wrote: It mean i must have a config file for the server and one for localhost
Not really. Default config file will have http://localhost base URL, and then you can create a separate config file for your server with a proper base URL: http://www.codeigniter.com/user_guide/libraries/config.html?#environments