Script to redirect if server is down

hi all

i need to have a script that will check if server A is down and then redirect to server B. i guess that the script will be hosted on another site in order to do these checks. I would appreciate if someone can point me in the right direction to achieve this.

thanks

Can you be a little more descriptive? I’m not sure what you’re asking.

Here’s how I understood it: When the client requests a page, you want to be able to check if the server that hosts that page is down; if the server is down, then redirect the user (with an HTTP header, perhaps?) to a different server that has either the page they were looking for or a message about technical difficulties.

How close am I?

yes that is exactly what i want but if the server is down then the redirection can’t be done with an http header because nothing will run on that server. so a script on a separate server should check first server and if it’s down it should redirect to server b
thanks

This is something that is much better done with server-side code such as PHP or .NET