473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Trying to understand redirection script behaviour.

pdc
I have two web servers that I use, one is the primary and the other is a
backup for when the server is down.
I use a third, central server which redirects a browser's initial link to
one of my web servers.
Rather than getting involved with CGI to determine the status of the web
servers, I found and implemented the following javascript.

<!- this is a very simple page that uses javascript to detect
whether or not a gif file can be obtained from a system's
web server.
If the gif file cannot be found, either because the system
is down or the webserver is inactive, then the imageError
function redirects the browser to a backup server.
-->
<head>
<title>PDC's start</title>
<SCRIPT LANGUAGE = "JavaScript">
<!--
function imageError()
{
top.location = "http://webserver2/home.html";
}
function imageLoad()
{
top.location = "http://webserver1/home.html";
}
var imgTest = new Image();
imgTest.onerror = imageError;
imgTest.onload = imageLoad;
imgTest.src =
"http://webserver1/ThisGIFimageControlsWhichWebServerisChosen.gif";
-->
</SCRIPT>
<HTML>

IE. the redirection proceeds as required. Trouble is, I don't want to use
IE.

Using Firefox (1.5.0.1)
What I notice is that it is only partially successful in doing what I want.
If I rename the gif file, for example, the redirect works well and
webserver2 is chosen.
But if webserver1 or the machine that webserver1 runs on is down, then the
initial request fails, still trying to access webserver1/home.html
Is this WAD, or is there anything I can tweak to ensure that when webserver1
is unavailable then webserver2 is accessed?

Feb 14 '06 #1
1 1257
pdc
just to add, my firefox browser has enabled javascript
thanks!
"pdc" <pd*@cdp.moc> wrote in message
news:lC*******************@news20.bellglobal.com.. .
I have two web servers that I use, one is the primary and the other is a
backup for when the server is down.
I use a third, central server which redirects a browser's initial link to
one of my web servers.
Rather than getting involved with CGI to determine the status of the web
servers, I found and implemented the following javascript.

<!- this is a very simple page that uses javascript to detect
whether or not a gif file can be obtained from a system's
web server.
If the gif file cannot be found, either because the system
is down or the webserver is inactive, then the imageError
function redirects the browser to a backup server.
-->
<head>
<title>PDC's start</title>
<SCRIPT LANGUAGE = "JavaScript">
<!--
function imageError()
{
top.location = "http://webserver2/home.html";
}
function imageLoad()
{
top.location = "http://webserver1/home.html";
}
var imgTest = new Image();
imgTest.onerror = imageError;
imgTest.onload = imageLoad;
imgTest.src =
"http://webserver1/ThisGIFimageControlsWhichWebServerisChosen.gif";
-->
</SCRIPT>
<HTML>

IE. the redirection proceeds as required. Trouble is, I don't want to use
IE.

Using Firefox (1.5.0.1)
What I notice is that it is only partially successful in doing what I
want. If I rename the gif file, for example, the redirect works well and
webserver2 is chosen.
But if webserver1 or the machine that webserver1 runs on is down, then the
initial request fails, still trying to access webserver1/home.html
Is this WAD, or is there anything I can tweak to ensure that when
webserver1 is unavailable then webserver2 is accessed?

Feb 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RX | last post by:
I try to use PHP to redirect to other page and failed. Please give me a help. Thanks. The script is: if($rows_num>0) { session_start(); session_register("userid");...
5
by: Jerry | last post by:
Hi All I would very much appreciate your help: I have two scripts alternating in the background triggering themselves mutually. Here is how: 1.) Script A does something and then calls Script...
1
by: slash | last post by:
Hi, I have a page on my website that is driven dynamically off of a database by a perl/cgi script. The page contents are essentially reports of the following url:...
8
by: Manu | last post by:
Hi there, I am using a perl script to generate this html page which just redirects users to my ftp server. The problem is I get a "page cannot be displayed" in IE 6.0 (haven't tried other...
2
by: Rick N. Backer | last post by:
Hello folks, Novice type question here. I'm working with a very simple app here that takes a series of strings from the console. Once the end user has finished inputting the strings they are...
15
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects...
7
by: Steph | last post by:
Bonjour, Je souhaite lancer une redirection vers un fichier php via SRC= dans une condition if (voir ci-dessous en bas du script) mais la redirection ne fonctionne pas. Par contre la condition...
4
by: Phil Powell | last post by:
I thought this would work but it seems to not work neither in Netscape nor in IE: <script type="text/javascript"> <!-- // OBTAINED FROM http://www.javascripter.net/faq/settinga.htm //...
1
by: comp.lang.php | last post by:
require_once("/users/ppowell/web/php_global_vars.php"); if ($_GET) { // INITIALIZE VARS $fileID = @fopen("$userPath/xml/redirect.xml", 'r'); $stuff = @fread($fileID,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.