no moc som sa s tym nehral, takze mozno bude treba osetrit ci su premenne nastavene, ale mohlo by to byt nejak takto:
<?php
$host = $_SERVER['SERVER_NAME'];
$page = $_SERVER['PHP_SELF'];
$query = $_SERVER['QUERY_STRING'];
if(ereg("^www.", $host) == false)
{
$url = "http://www.".$host.$page."?$query";
header("Location:$url");
}
?>
a tu je test: http://test.w3tech.sk/host.php a http://www.test.w3tech.sk/host.php