Welcome to the Treehouse Community
Looking to learn something new?
Sue Dough35,800 Points
Error Establishing Database Connection Hack
Ever had a wordpress site go down? Nothing is worst than your clients/users/members etc seeing an "error establishing database connection".
I want to share a hack with you guys.
You can add a file called db-error.php in your wp-content folder. Add the following snippet at the top of the file.
<?php header("HTTP/1.0 500 Internal Server Error"); ?>
You can then make a static HTML page with inline CSS. You could make a cool page for this error when it comes up.
Do not use us get header or get footer as your site can't connect.
<?php get_header(); ?> or <?php get_footer(); ?>
Let me know if you have any questions. This is an undiscussed topic but great for building big sites with lots of traffic that can go down.