Use wp_safe_redirect, props @johnjamesjacoby