Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Server for backups?

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > General IT Discussion
Register FAQ Community Calendar

checking if a site is up and running and if not redirect
Reply
 
Thread Tools
Old 26-02-2009, 11:20   #1
funkyCable
Inactive
 
Join Date: Aug 2005
Location: Canvey Island, Essex
Services: SERVICES FROM 26/08/05 TV XL services 2MB BROADBRAND UNLIMITED TALK PACKAGE V+ Service (Since 18
Posts: 1,195
funkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nice
checking if a site is up and running and if not redirect

Hi,

I'm setting up a laptop at home to be a webserver but want I wanted to know is whether I could have my domain name point to my blueyonder site which will just state that my server is down for the moment and to try again later. If the server is up then my domain should point to my laptop.


Any ideas if this is possible and if so how do I go about it?
funkyCable is offline   Reply With Quote
Advertisement
Old 26-02-2009, 13:45   #2
Pushkar
Inactive
 
Join Date: Mar 2007
Posts: 378
Pushkar is just really nicePushkar is just really nicePushkar is just really nicePushkar is just really nicePushkar is just really nicePushkar is just really nice
Re: checking if a site is up and running and if not redirect

Quote:
Originally Posted by funkyCable View Post
Hi,

I'm setting up a laptop at home to be a webserver but want I wanted to know is whether I could have my domain name point to my blueyonder site which will just state that my server is down for the moment and to try again later. If the server is up then my domain should point to my laptop.


Any ideas if this is possible and if so how do I go about it?
Bit confusing but do you want:

When your server (aka home laptop) is running then it should point to that

But when your server (aka home laptop) is turned off, then it should say try later?

If so, it's possible but I just don't know how to do it!
Pushkar is offline   Reply With Quote
Old 26-02-2009, 14:17   #3
funkyCable
Inactive
 
Join Date: Aug 2005
Location: Canvey Island, Essex
Services: SERVICES FROM 26/08/05 TV XL services 2MB BROADBRAND UNLIMITED TALK PACKAGE V+ Service (Since 18
Posts: 1,195
funkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nice
Re: checking if a site is up and running and if not redirect

Thats bang on.
funkyCable is offline   Reply With Quote
Old 26-02-2009, 14:31   #4
Horace
©Beam Software
 
Horace's Avatar
 
Join Date: Jan 2004
Location: Teesside
Services: BB (200mbit), 1x V6, iPad, iPhone
Posts: 1,411
Horace has reached the bronze age
Horace has reached the bronze age
Re: checking if a site is up and running and if not redirect

I assume you're using some kind of dynamic address system such as dyndns since giving out IP's is messy. If so they have an offline redirect which would accomplish what you're suggesting. You'll need to look into the site since I'm a free user and I can't see an option for it but I know it's available on pay accounts.
Horace is offline   Reply With Quote
Old 26-02-2009, 14:34   #5
funkyCable
Inactive
 
Join Date: Aug 2005
Location: Canvey Island, Essex
Services: SERVICES FROM 26/08/05 TV XL services 2MB BROADBRAND UNLIMITED TALK PACKAGE V+ Service (Since 18
Posts: 1,195
funkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nice
Re: checking if a site is up and running and if not redirect

I am using dyndns as a free user as well. I have my domain setup with 1-2-3reg.co.uk
funkyCable is offline   Reply With Quote
Old 26-02-2009, 18:18   #6
Yeowser
Inactive
 
Join Date: Jun 2007
Location: Swindon
Services: VIP
Posts: 15
Yeowser is an unknown quantity at this point
Re: checking if a site is up and running and if not redirect

I would suggest you leave your domain pointing to the blueyonder space and script that particular page to check on the status of you personally hosted site to forward/present error as required.
Yeowser is offline   Reply With Quote
Old 26-02-2009, 19:21   #7
KingDaveRa
Inactive
 
Join Date: Feb 2009
Location: Aylesbury, Bucks
Age: 43
Services: Broadband Gamer, Phone M, Tivo V6.
Posts: 269
KingDaveRa is a jewel in the roughKingDaveRa is a jewel in the roughKingDaveRa is a jewel in the roughKingDaveRa is a jewel in the roughKingDaveRa is a jewel in the rough
Re: checking if a site is up and running and if not redirect

I doubt the BY webspace supports any sort of 'clever' scripting, i.e. PHP. Possibly perl though.

If it did, you could potentially have it do a quick connection on port 80 to see if your site was up, and then send a redirect header to redirect the page. It'd actually only be a few lines of PHP to implement. But it's reliant on the PHP being there.

TBH, get a proper web host.
KingDaveRa is offline   Reply With Quote
Old 26-02-2009, 20:53   #8
funkyCable
Inactive
 
Join Date: Aug 2005
Location: Canvey Island, Essex
Services: SERVICES FROM 26/08/05 TV XL services 2MB BROADBRAND UNLIMITED TALK PACKAGE V+ Service (Since 18
Posts: 1,195
funkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nicefunkyCable is just really nice
Re: checking if a site is up and running and if not redirect

having a look at the BY webspace help http://www.virginmedia.com/customers...space-help.php and it seems to support PHP, perl etc.

Could anybody here help me with it? I just got the basics of php
funkyCable is offline   Reply With Quote
Old 27-02-2009, 16:12   #9
KingDaveRa
Inactive
 
Join Date: Feb 2009
Location: Aylesbury, Bucks
Age: 43
Services: Broadband Gamer, Phone M, Tivo V6.
Posts: 269
KingDaveRa is a jewel in the roughKingDaveRa is a jewel in the roughKingDaveRa is a jewel in the roughKingDaveRa is a jewel in the roughKingDaveRa is a jewel in the rough
Re: checking if a site is up and running and if not redirect

Holy crap, Python too! Ex-BY customers only though.

Here in php we have:

PHP Code:
<?php
// Try to open a socket to the server at home on port 80
$fp fsockopen("myhomesever.dyndns.net"80$errno$errstr10);
if (!
$fp) {
    
// Site is down, so we give an error - probably a PHP error too. This could be better!
    
echo "The site is down.";
    
} else {
    
// Site is up, so redirect to it
    
header('Location:http://myhomeserver.dyndns.net');
    
fclose($fp);
}
?>
Quick and dirty starter for 10.
KingDaveRa is offline   Reply With Quote
Old 27-02-2009, 21:27   #10
Caspar
Inactive
 
Join Date: Jun 2003
Location: UK
Posts: 4,988
Caspar has reached the bronze age
Caspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze ageCaspar has reached the bronze age
Re: checking if a site is up and running and if not redirect

You could use zoneedit.com - supports failover DNS, take a look.
Caspar is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:53.


Server: osmium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum