codeigniter redirect to different controller
First of all, you are doing a very poor job of checking if the user is authenticated (just passing username/pass to model isn't best, should process / check it before sending to model).
You can make redirects easily by including the helper 'URL' and simply use:
redirect('/controller/method');
or in a real world example:
redirect('/main');
Reference Link