I am new to codeigniter. I have just made a login feature in CI with the help of google, but here I am redirecting to URL on login but It is not working.
Here is the details
after redirecting the link is like this http://localhost/xpensepedia/index.php/home
which is giving the 404 error
404 Page Not Found
The page you requested was not found.
and my controller is
public function index() {
$this->load->view('header');
if (($this->session->userdata('user_id') != "")) {
redirect(site_url('home'));
} else {
$this->load->view("register");
}
$this->load->view('footer');
}
My files are in the image

Kindly check name of class you given to home.php Controller
Try this...
public function index() {
if (($this->session->userdata('user_id') != "")) {
redirect(site_url('home'));
} else {
$this->load->view('header');
$this->load->view("register");
$this->load->view('footer');
}
}
Home Controller :
class Home extends CI_Controller {
Public function index {
$this->load->view('header');
$this->load->view("home");
$this->load->view('footer');
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With