You ever bear in mind seeing a display screen like Error Establishing a Database Connection in your website. This could occur for numerous causes, however typically customers don’t know that their website is down. Additionally that web page itself appears fairly ugly in itself. On this article, we are going to present you customise your database error web page in WordPress. We may even present you setup a notification for each time your web site goes down as a consequence of a database error.
Open a brand new file and reserve it as “db-error.php”. Paste the next content material inside that. Then add the file in your /wp-content/ listing.
<?php // customized WordPress database error web page
header('HTTP/1.1 503 Service Quickly Unavailable');
header('Standing: 503 Service Quickly Unavailable');
header('Retry-After: 600'); // 1 hour = 3600 seconds
// If you happen to want to electronic mail your self upon an error
// mail("your@electronic mail.com", "Database Error", "There's a drawback with the database!", "From: Db Error Watching");
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Database Error</title>
<type>
physique
</type>
</head>
<physique>
You bought issues.
</physique>
</html>
Supply: CSS Tricks
If you would like electronic mail notifications, then remark out the mail line. To remark it out, you need to take away // earlier than the mail operate. Be happy to customise the touchdown web page nevertheless you want. Use these 404 design inspirations as a begin.