url rewriting – Categories of Custom Post throws gives 404

I’ve created a custom post type for a website. This is the code:

// Register Custom Expert Advice
function expert_advice_post_type() {
    $labels = array(
        'name'                => __( 'Expert Advice' ),
        'singular_name'       => __( 'Expert Advice')
    );
    $args = array(
        'label'               => __( 'expert-advice'),
        'description'         => __( 'Expert Advice'),
        'labels'              => $labels,
        'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'custom-fields'),
        'public'              => true,
        'hierarchical'        => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'has_archive'         => true,
        // "has_archive"         => 'expert-advice',
        'can_export'          => true,
        'exclude_from_search' => false,
        'yarpp_support'       => true,
        'taxonomies'          => array('post_tag'),
        'publicly_queryable'  => true,
        'capability_type'     => 'post',
);
    register_post_type( 'expert-advice', $args );
    
    add_image_size( 'like_thumbnail', 262, 175,true );
    add_image_size( 'arhive_thumbnail', 350, 300,true );
}
add_action( 'init', 'expert_advice_post_type', 0 );

add_action( 'init', 'expert_advice_custom_taxonomy', 0 );
function expert_advice_custom_taxonomy() {
 
  $labels = array(
    'name' => _x( 'Categories', 'taxonomy general name' ),
    'singular_name' => _x( 'Category', 'taxonomy singular name' ),
    'menu_name' => __( 'Categories' ),
  );    
 
  register_taxonomy('expert-advice',array('expert-advice'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'show_admin_column' => true,
    'query_var' => true,
    'rewrite'      => true,
  ));
  }

It seems to work fine for posts but it throws 404 for archive pages.

I am looking for url structure like this :

Event post type archive URL:
/expert-advice

Event post type URLs:
/expert-advice/example-event-post-name/

Event category URLs:
/expert-advice/category/