class MY_Exceptions extends CI_Exceptions
{
function show_404($page = '', $log_error = TRUE)
{
// By default we log this, but allow a dev to skip it
if ($log_error)
{
log_message('error', '404 Page Not Found --> '.$page);
}
include('./404.php');
exit;
}
function show_error($heading, $message, $template = 'error_general', $status_code = 500)
{
include('./404.php');
exit;
}
// --------------------------------------------------------------------
function show_php_error($severity, $message, $filepath, $line)
{
include('./404.php');
exit;
}
}
位于application/core文件夹下,和system文件夹下的位置一样,无需手动加载!!!
重写404页面,使之显示apache自定义的404页面