The status check can be done using e.g. Net::Ping. How to do the redirection depends on what webserver you use and whether you want to redirect just one page or a whole bunch of pages.
Update: Here's a quick&dirty script for the first case:
use Net::Ping; my $host = "www.server.com"; my $alive_url = "http://www.server.com/somepage"; my $dead_url = "http://www.backupserver.org"; my $p = Net::Ping->new(); my $url = $p->ping($host) ? $alive_url : $dead_url; $p->close(); print <<EOT; Status: 302 Moved Temporarily Content-Type: text/html Location: $url <p>Go to <a href="$url">$url</a>.</p> EOT
In reply to Re: Redirection
by crenz
in thread Redirection
by Kedos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |