RE: [PHP] Making an app unviewable during system maintainance
| From: | Chris W. Parker | Date: | Tue, 20 Apr 2004 22:49:24 +0000 |
| Subject: | RE: [PHP] Making an app unviewable during system maintainance | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-184072@lists.php.net to get a copy of this message | ||
daniel@electroteque.org <mailto:daniel@electroteque.org>
on Tuesday, April 20, 2004 3:41 PM said:
> Hi there I was wondering how people usually turn the app off during
> system maintainance. During the hours of 6-7 the database goes down
> for backing up, the users therefore keeping trying to get into the
> system, i get an error that the database is down when i know it
> should be down near that time. Without causing too many if statements
> what is the best way to do this ?
i don't know if this is possible (it probably is) but maybe you could
have apache serve a "server down" page for all requests to the website?
alternatively, using php it'd be something like the following:
store_open.php:
<?php
define("STORE_IS_OPEN", false);
if(!STORE_IS_OPEN)
{
header("Location: server_down.php"); exit;
}
?>
index.php:
<?php
require "store_open.php";
// rest of page
...
?>
if the store is open the user will see what they are expecting. if the
store is closed they will be redirected to the server_down.php page.
hth,
chris.