How to redirect a page in CodeIgniter?
Use the redirect()
function from the URL Helper.
EDIT:load the url helper:
$this->load->helper('url');if (condition == TRUE) { redirect('new_page');}
Use redirect() helper function.
Example :
$this->load->helper('url');if ($logged_in == FALSE){ redirect('/login/form/', 'refresh');}
Try this code after your if statement
redirect(site_url('/index'));
I hope that is helpful for you.