in reply to Redirection
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Redirection
by dug (Chaplain) on Apr 15, 2003 at 19:25 UTC |