Is there a script that I can use that would check if fye.x10hosting.com is up and if it is down send connections to fyebackup.freehostia.com? My members keep telling me my site is down. I'd like to send them to a little page on a different server that tells them the server is down and not to tell me. So all I need is the script that checks the status. It would be on a server that has low downtime. Thanks for any help!
I was given the following by Torch on the x10hosting forums.
So I adjusted it to this:
I get a connection was reset error in firefox if the main server is offline.
The file is located here: http://h1.ripway.com/chougard/index.php
I was given the following by Torch on the x10hosting forums.
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!";
}
?>
So I adjusted it to this:
Code:
<?
error_reporting(0); // Disables error reporting
$URI = "fye.x10hosting.com"; // Your main server address, can be IP too (DON'T PUT http://)
$URI2 = "64.72.112.14"; // 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!";
}
?>
I get a connection was reset error in firefox if the main server is offline.
The file is located here: http://h1.ripway.com/chougard/index.php