Created
October 16, 2012 14:04
-
-
Save achilles283/3899468 to your computer and use it in GitHub Desktop.
Custom WordPress Database Error Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Put a file called "db-error.php" directly inside your /wp-content/ folder and WordPress will automatically use that when there is a database connection problem. | |
// custom WordPress database error page | |
header('HTTP/1.1 503 Service Temporarily Unavailable'); | |
header('Status: 503 Service Temporarily Unavailable'); | |
header('Retry-After: 600'); // 1 hour = 3600 seconds | |
// If you wish to email yourself upon an error | |
// mail("[email protected]", "Database Error", "There is a problem with the database!", "From: Db Error Watching"); | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Database Error</title> | |
<style> | |
body { padding: 20px; background: red; color: white; font-size: 60px; } | |
</style> | |
</head> | |
<body> | |
You got problems. | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment