Please check and explain why this wordpress rewrite rule isn't still working.
function myplugin_rewrite_rule() {
add_rewrite_rule( '^music/record-year/([^/]*)/?', 'music/?record_year=$matches[1]','top' );
}
add_action('init', 'myplugin_rewrite_rule', 10, 0);
I wanted if music/?record_year=2019 is visited, it should be music/record-year/2019 instead
music/record-year/2019
does it work as expected?music/?record_year=2019
redirecting tomusic/record-year/2019
is a redirect and has nothing to do (directly) with rewrite rules. Same goes for changing any links. Rewrite URLs make the URL work, but redirecting and links need to be handled separately.