Solved

Redirection with error handling

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
egit plugin on eclipse 8 82
how to add new optional parameter to JSP 1 49
null output 3 35
restrict decimal places for double datatype 10 19
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

790 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