grazie a tutti
era proprio il header("location: http://"); che mi serviva