Solved

Redirection with error handling

Posted on 2001-06-11
5
167 Views
Last Modified: 2011-09-20
I have two mirrored web servers in different locations with users being directed from a third server.  On the third server is a simple script that automatically redirects the user to site 1.  I want a script that will check site 1, if its available redirect.  If site 1 is not available it needs to automatically redirect to site 2.

Thanks
0
Comment
Question by:elisch
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
venkat2000120699 earned 275 total points
Comment Utility

Create a WSH (VBS or JS) script that uses the FileSystemObject to locate a batch file located on the server. The batch file needs to ping a location and takes a URL as a argument.
Use WScript's Shell com object to Run the batch and trap any errors.
Successful pinging returns 0.
0
 
LVL 1

Author Comment

by:elisch
Comment Utility
Could you please elaborate a little?  What else do I put in the batch file besides a ping command?  What does the Wscript look like that would run the batch file and trap errors?

Thanks,
Eli
0
 
LVL 2

Expert Comment

by:venkat2000120699
Comment Utility
Go thru the article at: http://www.4guysfromrolla.com/webtech/102998-1.shtml

It will help u.
0
 
LVL 2

Expert Comment

by:venkat2000120699
Comment Utility
There is one more solution to your problem, which is not reasonably good.  

Write <img> tag in the html file, which tries to include an image from server 1, and in its onError attribute, call a javascript function which directs it to server 2.

eg: <img src="http://server1.com/img1.gif" onError="javascript:redirectToServer2()">
0
 
LVL 1

Author Comment

by:elisch
Comment Utility
Very helpful, thank you!!!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now