note
Dog and Pony
Untested, but something like this should be well enough:
<code>
#!/usr/bin/perl
use warnings;
use strict;
use CGI 'redirect';
use LWP::Simple 'head';
if(head('http://siteB.com'))
{
print redirect('http://siteB.com');
}
else
{
print redirect('/404'); # already at siteA
}
</code>
<code>head</code> should return true (and some info) only if the site asked is up and working. If it isn't enough, you might want to look at [id://126739], especially [merlyn]'s answer.
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-141348">
<hr />
<i>You have moved into a dark place.<br />
It is pitch black. You are likely to be eaten by a grue.</i>
</div></div>
380026
380026