Quindi

ob_start();
hader(location:blabla)
ob_end_flush();

oppure ob_start prima dell' output html?