There are ALWAYS alternatives! CSS is the answer to rendering you pages cross-browser... even if a browser doesn't support something there are usually similar acceptable solutions for troublesome browsers. And there are a lot mor browsers than just IE, Firefox and Safari.... not a good idea to check them by "name" check by name / type. I am using a dev version of Firefox... it doesn't say firefox... it says Shiretoko, but uses the Gecko engine so you have to check for the engine that is the same.
For server side browser redirection or content replacement, I use PHP
<?php
$d = detect();
$b = $d['browser'];
$v = $d['version'];
$o = $d['os'];
function detect()
{
$browser = array ("IE","OPERA","MOZILLA","NETSCAPE","GECKO","FIREFOX","SAFARI","CHROME","BLACKBERRY");
$os = array ("WIN","MAC","LINUX","ANDROID","BSD","SOLARIS","IPHONE");
$info['browser'] = "OTHER";
$info['os'] = "OTHER";
foreach ($browser as $parent)
{
$s = strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent);
$f = $s + strlen($parent);
$version = substr($_SERVER['HTTP_USER_AGENT'], $f, 5);
$version = preg_replace('/[^0-9,.]/','',$version);
if ($s)
{
$info['browser'] = $parent;
$info['version'] = $version;
}
}
foreach ($os as $val)
{
if (eregi($val,strtoupper($_SERVER['HTTP_USER_AGENT']))) $info['os'] = $val;
}
return $info;
}
if ($o == "OTHER" && $b == "OTHER") {
echo " something for unsupported os and unsupported browser";
} else {
echo "something for everybody else ";
}
?>
This sample contains most of the options you might need... just change it to suit your needs. But remember, the User Agent string CAN be faked in various ways by the user. More info on User Agent strings.