Graceful redirect in case of database error (5 posts)

  1. jokersson
    Posted 8 years ago #

    Is it possible to have the page redirected to a landing page when the database connection is broken? This would be more presentable, rather than the default WordPress database error page. Any idea if this could be done? Cheers!

  2. whooami
    Posted 8 years ago #

    sure.. its already done actually

    take a look at wp-includes/functions.php

    the last function, dead_db

    you can see what its doing right there. Notice the file it looks for??

    theres your landing page :)

  3. Maxormark
    Posted 8 years ago #

    I can't find any mention of this wonderful function anywere: not on the web, not in my Worpress installations, nowhere.
    Could you please be a little more explicit?

  4. whooami
    Posted 8 years ago #


    What is more explicit than saying the file name?


    and saying its the last function.

    Maybe you are not looking in the right version -- I typically provide answers using the most recent version as a starting point.

  5. Khairil Zhafri
    Posted 8 years ago #

    Create a custom page named db-error.php in /wp-content/.

Topic Closed

This topic has been closed to new replies.

About this Topic