I am using CodeIgniter for two applications (a public and an admin app). The important elements of the document structure are:
/admin
/admin/.htaccess
/admin
It happens cause of multiple reasons but the answer missing above there's the "className" while extending your controller.
Make sure your class name is the same as your controller name is your controllers. e.g., If your controller name is Settings.php, you must extend the controller like.
class Settings extends CI_Controller
{
// some actions like...
public function __construct(){
// and so and so...
}
}