In codeigniter, as you know, a page of the form: /class/function/ID, where class is the controller name, function is the method within the controller, and ID is
/class/function/ID
$this->output->set_status_header('404');
to generate 404 headers.