Taxinomy slug as var in parent archive page, without having a specific taxinomy page

My first idea (I’m not sure it’s the most efficient) is to do a redirection in the file category.php or archive.php depending of your theme.

Try with this code before the get_header() line :

$term = get_queried_object();


if (    ("category" === $term->taxonomy)
    &&  (0 !== $term->parent) // if it's not a 1st level category
) {

    // get the parent
    $parent = get_term($term->parent);


    // redirection

    $url = get_term_link($parent) . "#" . $term->slug;

    wp_redirect($url);
    exit();

}

this code only work with a 2 levels taxonomy because the redirection ends at the 1st level.