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'
);
Related Posts:
- Custom pages with plugin
- Add rewrite rule to permalink structure
- Add Rewrite Rule for custom page
- add_rewrite_rule, plugin activation and plugin deactivation
- What is the best way to output plugin result in certain url
- flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
- Custom rewrite rule is not picked by WordPress
- Add .html extension to custom post type taxonomies
- Woocommerce different URL for every table placed in the restaurant
- Author Specific URL’s in WordPress
- Does flush_rewrite_rules() remove all rules added by other plugins as well as mine?
- Add_rewrite_rule doesn’t add custom url in plugin
- Nested CPT URLs + Posts 2 Posts
- How can I rewrite a plugin generated URL?
- flush_rewrite_rules() not working on plugin activation
- WordPress custom URL Rewrites redirecting not masking
- custom taxonomy and custom post type url conflict
- Rewrite url without flushing the database?
- WordPress URL redirect
- Best way to hook a custom url?
- Checking that the Rewrite API is available
- How does WP handle multiple matching rewrite rules?
- How to Create a Custom Plugin Permalink
- Why slash is removed after domain?
- how to change the verification url of pie register plugin of wordpress?
- Plugin appends ugly URL string to index
- Custom rewrite rules not working with WPML
- Rewrite rule not matching
- How to Create a Custom Slug for Tags and Categories with a prefix or suffix?
- URL rewrite of independent plugin?
- Plugin generated taxonomies’ permalinks with custom placeholders
- Locked out of admin panel after installing HC Custom WP-Admin URL [closed]
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- Custom url rewriting
- How to customize a title by passing query string?
- WordPress plugin url for form submit
- Creating author Specific page URL
- URL rewrite with external JSON query
- Username Variable in custom links?
- WordPress rewrite rules not working
- How to rewrite URL and get the values?
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- How to force load a page in plugin?
- How to embed a new string in url?
- i want to rewrite my custom plugin url
- rewrite file to wordpress
- TranslatePress | secondary language category/sub-category not working correctly “`/%category%/%postname%/“`
- Dynamic URL Rewrite for Custom
- Change language on website and change currency with url query
- add_rewrite_rule to load different page, without changing URL in browser
- Hidden permalink different from displayed permalink
- WordPress rewrite rule depend on meta values not ids
- Custom Rewrite Rule Removing Query String
- one url for all pages
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- Change custom rewrite rule when permalink is updated/changed
- How to give .html extension to just one post not all post
- URL Rewrite 404
- WordPress drop domain alias
- catch urls with specific pattern and show specific content for them by plugin
- I am trying to rewrite urls in WordPress, but its not working
- Get custom term link archive with prefix
- How to regenerate slugs for categories and tag converting non-Latin characters?
- Change default url to plugin custom post type
- Rewrite in plugin
- Custom pages with plugin
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Creating custom URL for async content
- URL RewriteRule doesn’t work when using WP Database Participants in my WordPress website
- Custom shortcode with dynamic rewrite
- How To Rewrite WordPress Pages URL Only?
- custom url with custom post
- How to remove post redirects
- Apache rewrite rules and wordpress problem
- URL Rewriting from a Plugin based on custom values
- How can I process all requests for a given directory in a URL with my plugin?
- Rewrite rule help for gallery plugin
- Plugin with custom domain
- How to get the real address from a url (permalink)
- Remove base from the custom post type URL [duplicate]
- WP Job Manger change jobs url (NOT slug)
- How can I output completely custom content with plugin while still having header, footer, sidebar etc [closed]
- Please Check this ‘.htaccess’ File
- How to rewrite URL using .htaccess in WordPress Plugin
- How to eliminate weird 404 errors in wp-admin?
- Publish Post After Click On A Link
- gallery option is not available in media upload box in costum theme option page
- Woocommerce disable shopping cart based on user roles
- How to add checkboxes for a woocommerce product? [closed]
- How to echo text in browser instead of download junk file?
- Add custom text color WordPress 3.9 TinyMCE 4 Visual editor
- ACF: post query, hide duplicate values [closed]
- WordPress Jquery UI Spinner
- Is there a plugin to turn comments into structured reviews [closed]
- Adding a simple Javascript file with a plugin
- Example for use tinymce in wordpress 3.5.1?
- Need to edit author permissions | custom taxonomy
- WP Import All Multiple Dynamic Link Imports
- plugins break after moving wp-content folder
- Change localization only for plugin