Controllers to handle errors

Would it be possible to handle errors (404, database) with a controller easily (I did find something by searching this forum, but it seemed to be a flawed implementation), or at least use CI functions in the error pages CI uses by default?

[eluser]Chris Newton[/eluser]
In your HTACCESS file, add:

ErrorDocument 404 /yourcontroller/your_error_function

Database errors should probably be written to a log, rather than displayed for security purposes.

Hi. Sorry to bump this.

I've built a controller to act as a 404 page. I currently have modified the exception library to send a redirection header to the controller, but there *must* be a better way to do this. For example, currently it goes like this: the page that the user requested returns 302 found instead of 404 (the actual 404 controller returns a 404 header, though).

I've went through pretty much every topic concerning this and I haven't found a good way to do it. How much would it take to modify the exception library to call a controller instead?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.