insert_with_markers() WordPress & htaccess help

I would suggest an alternative route: the rewrite API – did you know it supports external URLs*?

function wpse_199898_add_htaccess_rule() {
    // No need for the caret "starts with", WP will add it
    add_rewrite_rule( 'article/([/_0-9a-zA-Z-]+)$', 'http://www.domain.tld/?id=$1 [R=301,L,NC]' );
}

add_action( 'init', 'wpse_199898_add_htaccess_rule' );

*Almost. We just need a fix for WP’s quirky path prefixing:

function wpse_199898_fix_htaccess_rule( $rules ) {
    return str_replace( '/http://www.domain.tld/', 'http://www.domain.tld/', $rules );
}

add_filter( 'mod_rewrite_rules', 'wpse_199898_fix_htaccess_rule' );