Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web page redirection error handling

Status
Not open for further replies.

artskib

Programmer
Jul 17, 2002
8
US
I currently have 2 web departamental intranet servers.
The second server is acting as a backup.
From our main corporate page, I would like redirect to the first server. If the first server is not available, I do not want to see the classic "HTTP 404 - File not found". Instead, I would like to get redirected to the second server.

I have created a sample code (shown below), but I still get the 404 error instead ob being redirected to the second server.

<html>
<head>
<title>Redirect Page - Sample Code</title>
</head>
<script language="JavaScript">
onError = SecondLink()
window.location="
function SecondLink() {
window.location="}

</script>
<body >
You should be redirected to another page shortly.<br>
If the redirection does not take place (your browser may be not configured for JavaScript), please click <a href=" here </a>to get redirected.<br><br>
If the URL above did not work, please click <a href=" here </a>to get redirected.
</body>
</html>
 
So you are looking for a method to detect whether or not a page can be found? Ideally, you should use server-side scripting.

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top