Welcome Guest, Not a member yet? Register   Sign In
404 Help
#1

[eluser]ci_user[/eluser]
How can I use a custom 404 page and still set the header status to 404?
The custom 404 in routes.php:
Code:
$route['404_override'] = 'my_controller/custom_404';

If I set the header status to 404, my custom error method shows the regular ugly server error 404 page.
Code:
function custom_404 () {
$this->output->set_status_header('404');
$this->load->view('my_error');
}

But if I do not set the header to 404 (pointless), my custom error works.
Code:
function custom_404 () {
//$this->output->set_status_header('404');
$this->load->view('my_error');
}

I see examples where folks have loaded a view or sent some other output after setting the header status to 404... how can I do that?


Messages In This Thread
404 Help - by El Forum - 06-09-2012, 05:08 AM
404 Help - by El Forum - 06-09-2012, 07:22 AM
404 Help - by El Forum - 06-09-2012, 09:06 AM
404 Help - by El Forum - 06-11-2012, 05:21 AM
404 Help - by El Forum - 06-11-2012, 05:32 AM
404 Help - by El Forum - 06-12-2012, 06:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB