function Redirect($url, $permanent = false)
{
    if (headers_sent() === false)
    {
    	header('Location: ' . $url, true, ($permanent === true) ? 301 : 302);
    } else {
    	 echo "<script>location.href='".$url."';</script>";
    }
    exit();
}

Simply redirect to a Joomla URL such as

index.php?option=com_content&task=view&id=123