Are you failing to supply the trailing slash on the pre-rewrite URL? That regex won’t match without it.
Since your /parent-page and /parent-page/child-page are WordPress pages you shouldn’t be using .htacceess for this at all, because it would prevent WordPress from loading for those URLs. Instead you should be hooking to query_vars so WordPress won’t strip your new variable from the querystring and to rewrite_rules_array to handle the actual rewrite.
Related Posts:
- How to create custom 401, 403 and 500 error pages?
- PHP – redirect https to http and www to non-www
- Bypass .htaccess when using download_url
- How can I run a .php file located in my site’s root folder?
- Fix 403 error on WordPress multisite network using subdomains
- How to redirect all 404 in a WordPress subdirectory to the index.php of subdirectory?
- How to run multiple websites from single WordPress setup
- Using PHP in a Stylesheet (possibly a “.htaccess” problem?)
- How to override .htaccess with new rules without ftp or edit it manual
- WordPress-site can be reached on x.x.x.x/index.php – but not directly on the IP without index.php
- Change the actual (or viewable) WordPress directory structure
- Add htaccess rules with insert_with_markers at beginning of htaccess
- Cannot get media type from ‘x-mapp-php5’
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- How to change home or site url using action hooks or filter?
- Apache Fallback instead of add_rewrite_rule
- 3 blogs same installation, without WP MU
- Two Different Links for Same Product – WooCommerce [closed]
- Was told to change the .htacess file form .html to .php so this would work properly
- How to change redirection route to a php page for making it only accessible by logged-in members?
- how to combine wordpress htaccess on my root domain + php on subfolder
- subdirectory index.php is not working
- custom url rewrite for wordpress
- Loading index.php contents which located outside blog folder for post single page
- WP & Server Speed [Teacher Question]
- WordPress add_rewrite_rules for custom URLs ending in .html
- Troll the hackers by redirecting them
- Seo Friendly Filter URLs
- How to allow download url redirection only if user logged in WordPress site?
- How to disable all logins except Network login in WordPress Multi site?
- Removing files programmatically
- Is it possible to restrict files from your wordpress uploads (not logged-in users or guest)?
- Simple seo-friendly custom $_GET url rewrite with htaccess
- How to make Subdomain work for product_tag?
- How to serve WordPress folder over subdomain?
- Pages from admin dasboard missing after site migration
- Rewrite rule not working, but only when parameter is text
- Internal Server Errors – Moving working multi-site install to my localhost
- Deny php execution in /wp-includes – using .htaccess in /wp-includes VS root folder
- How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?
- How to block access to a folder inside of wp-content for non logged in users?
- WordPress Redirect / Add_Rewrite_Rule – Non Index.php Page
- Upload images from one server to an other in wordpress
- Problem with ajax request and directory structure after site migration
- How can I add “.html” to the end of a single URL on a WordPress website?
- Resource 404 error on multisite subdirectory install
- redirect 301 with special character like WIX site “#!”
- 301 redirect from webpage to wordpress page in the same root
- Rewrite /keyword1+keyword2.html to search page | .htaccess
- Redirect homepage /page/1/ to /blog/page/1/
- Enabling XSendFile causes 404 for images on WordPress Multisite / Network
- Why I can download any file except PHP files from a URL but I can download any from another site?
- 3 domains, 1 wordpress install, redirecting and changing domains on live site
- How to use multiple 404 Error Pages in WordPress
- Increase Upload Size with htaccess | MAMP
- wp-login – unable to redirect user to a custom login url
- NGINX rewrite rules for WordPress Subdirectory Multisite to support deep URL
- Display all values of custom a field created with ACF on a page
- wpdb::prepare was called incorrectly
- count number of user comments with a specific comment meta value
- Remove “Remember Me” from login form
- How can I change WordPress domain from remote to localhost?
- Notify WordPress Site I Have Linked To Them
- Woocommerce filter cart and category specific quantity [closed]
- Problem adding class to body_class
- Shortcode API: How to get name that matched shortcode RegEx?
- Swapping wp_dropdown_categories function with wp_category_checklist
- Is there a way to programmatically create multiple pages utilizing the same template but different content from a json file?
- Create Page To Count Comments For Each Post In WordPress Site
- Why my image upload button is not working in wordpress widget area?
- How does wp_enqueue_scripts work?
- Use of wp_insert_post and parameters
- get_users meta_query: REGEXP not working for matching new lines
- Where does “rel=0” get removed from my YouTube parameters?
- Custom array from a query only write the last row of the query
- Ajax button not working
- PHP if statement works in template files, but not header
- Get categories names as an array to use it in theme settings
- Custom route and query
- Automatically generator a WordPress installation on my subdomain
- Call to undefined function error in plugin
- Override index with a custom PHP page
- Creating a Category Taxonomy
- Menu not styling. New menus functionality giving me a headache
- Customizer control save then return to default
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- Use CSS tag inside PHP code
- Showing search results on a page
- How do I properly upgrade WordPress’s PHP within an OpenLiteSpeed GCP instance? [closed]
- i got this error : Warning: call_user_func_array() expects exactly 2 parameters, 3 given in
- Another site within WordPress page, disabling 404 error for pages that exist but outside of WP system
- Add parent menu item in sub-menu in custom nav_walker
- Insert div after every three posts in home.php [duplicate]
- How to remove image on single product and get product to span page?
- Display Content Based on Custom Field Value
- Custom field in title
- Dynamic Gallery
- Jquery autosave text area after typing
- Remove default Image Sizes
- How can add alt tag in following code. Image are showing dynamic in wordpress