WordPress add_rewrite_rule() cannot visit lower url levels

I fixed my problem as follows:

// Adds rewrite rules for shop post type
function gtp_add_shop_rewrite_rules() {
    add_rewrite_rule( '^shop/([^/]*)/([^/]*)/([^/]*)$', 'index.php?shop-category=$matches[1]&width=$matches[2]&height=$matches[3]', 'top' );
    add_rewrite_rule( '^shop/([^/]*)/([^/]*)$', 'index.php?shop-category=$matches[1]&width=$matches[2]', 'top' );
    add_rewrite_rule( '^shop/([^/]*)$', 'index.php?shop-category=$matches[1]', 'top' );
}
add_action('init', 'gtp_add_shop_rewrite_rules', 10, 0);