Having a problem with rewrite_rules and rewrite_tags – url not rewriting properly and query var missing

I have solved it, thanks to info gleaned from a ‘related question’ that showed up in the sidebar after posting mine.

The answer, found at Prettified page URL w/ query var redirects to prettified page URL w/o query var was to include the parent pagename as well as the child page name in the rewrite rule.

So instead of:

add_rewrite_rule(
    '^c/(.{6}).*?$',
    'index.php?pagename=childpage&lbc=$matches[1]',
    'top'
);

I changed it to:

add_rewrite_rule(
    '^c/(.{6}).*?$',
    'index.php?pagename=parentpage/childpage&lbc=$matches[1]',
    'top'
);