Ok, I wrote you up a short script that will check status of one server and if it's up redirect you to it, and if it's not, redirect you to another server. Or, if you un/comment correspoding lines (header and echo), just displays the error messages. The best way to use it would be to give out address of the server (site) you know that'll be up all the time, put it as an index.php there, and than people would be redirected where needed depending of server statuses.
Ok, here it is...
PHP Code:
<?
error_reporting(0); // Disables error reporting
$URI = "google.com"; // Your main server address, can be IP too (DON'T PUT http://)
$URI2 = "x10hosting.com"; // Your second server address
$TO = 5; // Timeout in seconds
if(fsockopen($URI,80,$TO)){
header("Location: http://$URI"); // Redirects to your server if it works
//echo "Server is working perfectly!";
}
else{
header("Location: http://$URI2"); // Redirects to your second server in case first one doesn't work
//echo "We are currently having some troubles with the server, please come back later!";
}
?>