Codeigniter echoing [::1] instead of localhost

Codeigniter echoing [::1] instead of localhost

I am using CodeIgniter 3.16 as a web platform and when redirecting with uri. I’m doing so by using CodeIgniter’s base_url() method in the href property for redirect.

base_url() echoes the domain has being [::1] and not localhost as I’ve typed into the browser.

For some reason, it is not appears to me the editor. It happening because of   [::1] is showing in url instead of  localhost as the same host, or maybe I’m just being dumb.



What exactly is causing php to echo such a path ?

Its because of your base_url is empty.

In config/config.php

$config['base_url'] = 'http://localhost/project_name';


Leave a Reply

Your email address will not be published. Required fields are marked *