404 redirect based on url
I would use the wp hook, which fires right after the request has been parsed and queried: function wpse_199869_wp( $wp ) { if ( ! is_admin() && is_404() && preg_match( ‘/^bh-job/’, $wp->request ) ) { wp_redirect( home_url( user_trailingslashit( ‘jobs’ ) ) ); exit; } } add_action( ‘wp’, ‘wpse_199869_wp’ ); We make sure it’s a 404, … Read more