@hube2 yes I get Warning: Cannot modify header information – headers already sent by (output started at /wp-includes/formatting.php:5740) /wp-includes/pluggable.php on line 1329
The code on that line is
$x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location );
if ( is_string( $x_redirect_by ) ) {
header( "X-Redirect-By: $x_redirect_by" );
}
header( "Location: $location", true, $status );
return true;
}
endif;