Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to redirect a client to a second server

Status
Not open for further replies.

clarissa1996

Technical User
Jan 31, 2002
78
CH
Hi,

I have a webpage installed on two different servers.
To improve system availability, if the first server is not available the client must be redirected to the second server.

To this purpose I have the following javascript installed on a third (high-available server).
The trick is to test if the file image.gif exists on the first server. If it's not possible to download this file, after 10 seconds the client is redirected to the second server.

This script works ok, but it seems that on certain clients it doesn't works (the client is always redirected to the second server).
I cannot debug this situation because I have no access to the client.

My question is:
is there a secure javascript to do this job ?

Thanks. Clarissa

------------------------------------------------------------

function host1() {
location.href = "}

function host2() {
location.href = "}

window.setTimeout("func2()", 10000);

document.write('Wait ...');
document.write('<img src=" onLoad="func1()"');
</script>
 
I wonder if there isn't a smarter way to do this that doesn't require the user has javascript enabled (nor does it require all users to wait for an image to download before they can progress).

Surely you could create a server-side solution that handed off the connections transparently.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
Hi Jeff, hi Dan,

thanks for the quick reply.
here is some more informations.

> it require all users to wait for an image to download before they can progress
The file image.gif is 1 pixel ...

> methods you can use for load-balancing
My problem is not load-balancing, is high-availability.

> the user has javascript enabled
My application (homepage) require javascript enabled too.

> you could create a server-side solution that handed off the connections transparently
I cannot install cgi-script on the third server.


Regards. Clarissa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top