[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Redirection with error handling

Posted on 2001-06-11
5
Medium Priority
?
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
venkat2000120699 earned 1100 total points
ID: 6179309

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
ID: 6179339
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
ID: 6179438
Go thru the article at: http://www.4guysfromrolla.com/webtech/102998-1.shtml

It will help u.
0
 
LVL 2

Expert Comment

by:venkat2000120699
ID: 6179452
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
ID: 6182754
Very helpful, thank you!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

650 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