简体   繁体   中英

CodeIgniter redirects replacing localhost URL with [::1]

I'm currently writing an application where I extend the CI_Controller class and check if a user is logged in, if they aren't I redirect them to the login page.

However, I'm finding that whenever I do this, my the URL it redirects to, changes from localhost/~username/ to [::1]/~username/

The system I'm using is OS X Yosemite and using safari

I've searched everywhere, but with no luck. Any ideas as to the cause of this and how to solve it?

May be your base_url is empty.

Setup the base_url

In config/config.php

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM