[eluser]Henrik Pejer[/eluser]
@sophistry:
The problem is that the server never gets the 404-error since all requests are routed through the index.php-file of CI. Its CI that send the 404-error, nothing else.
Something struck me: you could modify the show_404() function to redirect you to a custom error-page instead of extending the Routes_class. This way you can have a controller that will handle all you 404-errors
@Coolfactor:
I agree, its a much cleaner way of doing things, but the only problem I have with show_404 is that the complete CI-system has not loaded, so you can't directly in that function put calls to the db etc. Or you can, but it wouldn't be using CI-classes or you'd have to mimic the startup behaviour of CI in that function.
I think that modifying the show_404 to redirect to /custom404controller/ is much better, then what I did above. Its only a shame that I figured this out just now, instead of before I posted that code...
Thanks for you answers, sophistry and coolfactor!