codeigniter redirect not working codeigniter redirect not working codeigniter codeigniter

codeigniter redirect not working


As it turned out, setting the log threshold to 4 was the answer to figuring this out. I was able to determine that I was outputting some space, which prevented the redirect from working. Looking in the logs revealed this.

Thanks everyone for your help, and thanks Madmartigan for suggesting the log setting.


Try adding a ? at the end of index.php in your last rewrite rule as such:

RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]

If that doesn't work, try changing your $config['uri_protocol'] (if it's set to AUTO) to:

$config['uri_protocol'] = 'REQUEST_URI';


Change the top portion above your authenticate() method to this...

class Login extends CI_Controller {    function __construct()    {        // this is your constructor        parent::__construct();        $this->load->helper('form');        $this->load->helper('url');    }    function index()    {        //this is only called when someone does not specify a method...        $this->load->view('login_view');            }...

I would strongly recommend moving these two helpers to be autoloaded because of their almost manditory use...