Rewrite in plugin
You’re almost there, but your understanding of how rules work is slightly off. Also I would recommend using the page_rewrite_rules filter: function wpse_224942_page_rewrite_rules( $rules ) { global $wp_rewrite; /* Don’t forget to change “my_query_var” in the rewrite rule too */ $new_rules = array( ‘bz/([^/]+)/?$’ => $wp_rewrite->index . ‘?pagename=bz&my_query_var=” . $wp_rewrite->preg_index( 1 ), ); return $new_rules … Read more