i try to use custom 404 page from this tutorial http://maestric.com/doc/php/codeigniter_404
my controller error.php :
class Error extends Controller{
function error_404()
{
$CI =& get_instance();
$CI->output->set_status_header('404');
echo "error bro";
}
}
when i open link localhost/mading/admin/blablabla , where there is not function blablabla() in controoler admin. the output : “error bro”
i try change line in method error_404() become the code below,
class Error extends Controller{
function error_404()
{
$CI =& get_instance();
$CI->output->set_status_header('404');
$data['title'] = "404 Page Not Found";
$data['body'] = $CI->load->view('web/404','',true);
$CI->load->view('web/web_page',$data);
}
}
but, when i open link localhost/mading/admin/blablabla , where there is not function blablabla in controller admin. the output : blank page. the function error_404 not load the view . why the 404 page not load when i open controller admin/blablabla ??
thanks
404
andweb_page
located in your views directory? – Colin Brock