checking if a site is up and running and if not redirect
26-02-2009, 11:20
|
#1
|
|
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
|
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?
|
|
|
26-02-2009, 13:45
|
#2
|
|
Inactive
Join Date: Mar 2007
Posts: 378
|
Re: checking if a site is up and running and if not redirect
Quote:
Originally Posted by funkyCable
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!
|
|
|
26-02-2009, 14:17
|
#3
|
|
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
|
Re: checking if a site is up and running and if not redirect
Thats bang on.
|
|
|
26-02-2009, 14:31
|
#4
|
|
©Beam Software
Join Date: Jan 2004
Location: Teesside
Services: BB (200mbit), 1x V6, iPad, iPhone
Posts: 1,411
|
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.
|
|
|
26-02-2009, 14:34
|
#5
|
|
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
|
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
|
|
|
26-02-2009, 18:18
|
#6
|
|
Inactive
Join Date: Jun 2007
Location: Swindon
Services: VIP
Posts: 15
|
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.
|
|
|
26-02-2009, 19:21
|
#7
|
|
Inactive
Join Date: Feb 2009
Location: Aylesbury, Bucks
Age: 43
Services: Broadband Gamer, Phone M, Tivo V6.
Posts: 269
|
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.
|
|
|
26-02-2009, 20:53
|
#8
|
|
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
|
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
|
|
|
27-02-2009, 16:12
|
#9
|
|
Inactive
Join Date: Feb 2009
Location: Aylesbury, Bucks
Age: 43
Services: Broadband Gamer, Phone M, Tivo V6.
Posts: 269
|
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, $errstr, 10); 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.
|
|
|
27-02-2009, 21:27
|
#10
|
|
Inactive
Join Date: Jun 2003
Location: UK
Posts: 4,988
|
Re: checking if a site is up and running and if not redirect
You could use zoneedit.com - supports failover DNS, take a look.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 20:52.
|