nemuroito
nemuroito

Reputation: 179

Codeigniter does not redirect properly in remote server

I need a help here.

I want to ask why my CI doesn’t redirect properly in remote server? Everything in my localhost runs without any problem.

For example :

class Login extends CI_Controller {
    function index() {
        //bla bla bla
        redirect('dashboard','refresh');
    }
 }

After I login successfully, I get the url: http://www.test.com/%20//www.test.com/dashboard instead of: http://www.test.com/dashboard

This is a little silly problem and I have googled everywhere but no answer related, so any help would be appreciated.

Upvotes: 1

Views: 661

Answers (1)

mario
mario

Reputation: 145482

Well, okay, looked it up. This is the redirect() implementation from CodeIgniter (1.7.1):

             case 'refresh'  : header("Refresh:0;url=".$uri);

Not pretty, but shouldn't cause the problem you described. Somehow a space still slipped in. I suspect it's a non printing Unicode space variant, and your browser later translates it into a normal space. -- It might also be the $uri=site_url($uri) call mentioned in that very help function, but did not look that up. Might be a site misconfig then.

The alternative is just trying the normal location redirect.

    redirect('dashboard');

Upvotes: 2

Related Questions