[eluser]Henrik Pejer[/eluser]
So this is what I've come up with (so far?):
Code:
class MY_Exceptions extends CI_Exceptions{
function MY_Exceptions(){
parent::CI_Exceptions();
}
function show_404($page=''){
# Your code here...
# end with redirect to the custom 404 handler
# add on the end the request-uri (might only work with apache)
header('Location: /custom404controller'.$_SERVER['REQUEST_URI']);
exit;
}
}
Instead of extending routes, I extend exceptions, like coolfactor and others suggest. To be able to use a custom 404 controller, though, I have to redirect.
There, now we have the possibility to have a controller that can handle 404-errors and also use the complete CI framework. I really should have thought this through one more time before posting my initial code, sorry for that!
Happy CI:ing!