?
Solved

Redirection with error handling

Posted on 2001-06-11
5
Medium Priority
?
175 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 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