Solved

Redirection with error handling

Posted on 2001-06-11
5
168 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

863 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

25 Experts available now in Live!

Get 1:1 Help Now