How to ignore apparent subpages
-
I am rewriting a WordPress site and plan to turn part of it into an angular app.
The site has a bunch of sub-pages of the form
/recommendations/xxxxx
. I need all URLs to remain accessible for SEO purposes, I will keep the/recommendations
parent page but will do the sub-routing using Angular. but want all of the sub-pages to lead to the parent page BUT keep the sub-page routing in the URL for Angular to process.I think I need to use
add_rewrite_rule
but have got stuck, and the following does not work. I need wordpress to show the recommendations page even if there is an extra url-part subsequently.function recommendations_rewrite() { add_rewrite_rule('^recommendations\/(.*)\/?', 'recommendations/', 'top'); } add_action('init', 'recommendations_rewrite');
- The topic ‘How to ignore apparent subpages’ is closed to new replies.