Forum Moderators: coopster

Message Too Old, No Replies

Redirect page on remote web host when local server is offline

         

buzzme

5:32 pm on Jul 30, 2006 (gmt 0)

10+ Year Member



Hope some one can help . I have my web site hosted on powweb (my remote web host)and I want a user to be redirected when they access my local server through a link on my remote web site to another page on my remote web site when my local server is offline . I trust this makes sense and all replies welcome .

jatar_k

5:53 pm on Aug 1, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you would then need the remote server to first check for availability of your local server and then it can decide where to send them based on the response from your local server.

you could try fsockopen or cURL to test for it's availability

buzzme

9:47 am on Aug 5, 2006 (gmt 0)

10+ Year Member



I have tried using the following script but I cannot get it to redirect to my offline page when my local server is offline . Can anyone shed some light on the problem?

<?php
if (! $sock = @fsockopen('localserver', 80, $num, $error, 30))
header("location: [mylocalserver.com...]
else {
fclose($sock);
header("location: [myremotesite.com...]
}
?>

[edited by: jatar_k at 2:49 pm (utc) on Aug. 12, 2006]
[edit reason]
[1][edit reason] fixed sidescroll [/edit]
[/edit][/1]

jatar_k

2:49 pm on Aug 12, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what exactly does it do?

does it give you errors?