Reputation: 3981
How do I change the default route after a user is logged in? I'm using the CodeIgniter framework.
Upvotes: 0
Views: 91
Reputation: 1324
You can change the default route with
$route['default_controller'] = 'route';
in application/config/routes.php
Upvotes: 0
Reputation: 15652
Rather than changing the default route, you could simply have your controller act differently if they are logged in. Something like:
class Welcome extends CI_Controller {
public function index()
{
if($logged_in) {
$this->load->view('authenticated');
} else {
$this->load->view('guest');
}
}
}
Upvotes: 2