I redirect all my requests to index.php via htaccess and the code below is in my index.php.

I want to ask if my code is properly set for a custom 503 page for an unsuccessful MySQLi connection trial.

Is it also proper to use these metatags?

<meta name="robots" content="noindex,nofollow,noarchive">

$mysqli = new mysqli(HOSTX, USERX, PSWX, NAMEX);
if ($mysqli->connect_errno) {
    header($_SERVER["SERVER_PROTOCOL"]." 503 Service Unavailable");
    header( 'Content-Type: text/html; charset=utf-8' );
    header( 'Retry-After: 600' ); // 10 minutes
<!DOCTYPE html>
<html lang="tr">
    <meta charset="utf-8">
    <title>DB Connection Error</title>
    <meta name="description" content="DB Connection Error 503 sayfası" />
    <meta name="robots" content="noindex,nofollow,noarchive">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<p>DB Connection Error.</p><p>Please try in 1 or 2 minutes.</p>
  • \$\begingroup\$ metatag ok -> check HTTP CODE ok -> check does it work? what else is there to review? \$\endgroup\$ – braunbaer Feb 11 '15 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.