Forum Moderators: phranque

Message Too Old, No Replies

Redirect page on remote web host when local server is offline

         

buzzme

7:47 pm on Jul 29, 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 .

[edited by: jdMorgan at 9:14 pm (utc) on July 29, 2006]
[edit reason]
[1][edit reason] No URLs, please. See TOS. [/edit]
[/edit][/1]

jdMorgan

3:54 pm on Jul 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, the problem here is that the server that would normally need to do the 'redirect' will be offline.

So the alternative is to write a script using PERL or PHP, and call that script (using mod_rewrite, for example) instead of the page on your home server. The script would then use an HTTP Library function (see libWWW-PERL) to check the status of your home server, and if it is active, redirect or proxy the request to it. If the home server is off-line, then redirect or proxy the request to the local server.

This may be trivial if you're an expert in scripting and HTTP Libraries, but might make a 5-day project if you're just starting. Since I'm not an expert in either, that's all I can offer.

Jim