CodeIgniter Forums
redirect() returns blank page in live server but works in localhost - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: redirect() returns blank page in live server but works in localhost (/thread-74808.html)



redirect() returns blank page in live server but works in localhost - xlaws27 - 11-08-2019

i think i have tried all the solution in stackoverflow&ci forum but still, i cant make it work. i have no problem storing sessions and if i manually type the url i dont encounter any problems at all but when using redirect() in live server it doesnt work at all . it returns blank page and i am still at the current page/url

public
 function __construct() {
        parent::__construct();
        
        date_default_timezone_set("Asia/Kolkata");
        $this->load->model('AdminLogin_model');
        $this->load->model('Settings_model');
        $this->load->library('session');

        if($this->session->userdata('logged_in_admin')) { 
            redirect(base_url().'Bus_details/view_busdetails');
        }
    }


on autoload.php
$autoload['helper'] = array('url','pis');



RE: redirect() returns blank page in live server but works in localhost - InsiteFX - 11-09-2019

PHP Code:
redirect('Bus_details/view_busdetails''refresh'); 

You don't use base_url() in a redirect.