Reputation: 425
I'm looking for a way to redirect to an /error.php page when a fatal php error occurs. I have htaccess setup to log errors, but how can I redirect on fatal error using htaccess?
Upvotes: 1
Views: 437
Reputation: 4670
Use header with a shutdown function to forward them on fatal error.
register_shutdown_function('forward_fatal');
function forward_fatal(){
header("Location: error.php");
}
Upvotes: 2