This rule is what I ended up with after finding this post:
Understanding add_rewrite_rule
add_rewrite_rule( '^foo/([^/]*)/?$', 'index.php?pagename=foo-$matches[1]', 'top' );
Related Posts:
- Share same Slug for a Custom Post Type and 2 Taxonomies
- wordpress how to replace url /bar with foo/bar for custom post type
- Need help with add_rewrite_rule
- remove “index.php” from permalinks
- Custom post type permalink endpoint
- How to add a custom URL placeholder to author archives?
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Make post slug have priority over category slug
- Remove parent slug for child pages
- Remove parent slug for child pages
- Prepend meta_value to permalink of post
- Using two permalinks for one post
- flexible rewrite ‘ramble’ URLs with WordPress
- Change the custom post type permalink
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Rewrite url / permalink for default archive – yearly / monthly
- Permalinks, Rewrites, Get Variables, Oh My!
- Change permalink for a single post entry
- How to Modify Existing Rewrite Rules?
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- custom permalink/shortlink with base62 encoded post ID
- When is it a good idea to build a permalink structure from scratch?
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- Call to a member function add_rule() on a non-object
- I need a custom permalink for my website
- Change author slug and functionality
- How can I add a page’s ID to its permalink using WP_Rewrite?
- Permalinks: Page Not Found
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Re-write specific custom post type category URL to go to another page
- Remove custom taxonomy base from URL
- remove sub-category of Custom Post Type from permalink structure
- add_rewrite_rule not working for me
- Is a permastruct possible on pages?
- Using WP Rewrite, but just not “getting it”
- Rewrite rule for a query string
- How to remove specific category from URL in WordPress
- Rewrite CPT permalinks and include WPML language
- Custom permalink leads to index page
- Rewrite rule intended for CPTs gives 404 for pages
- Permalink structure between 2 custom post types and a taxonomy
- Permalinks only for posts
- Custom rewrite rule ignored
- Getting back a permalink from custom url
- Order custom post type posts by custom field with pretty URL
- Adding URL prefix for foreign language support
- Exclude single page from permalink rule
- Bulk append URL (add word to slug)
- help to remove last trailing slash using add_rewrite_rule
- How can I set up a secondary permalink structure?
- Rewrite rule not passing variable
- How to Use metada Value in Url and is it possible? [duplicate]
- Safest way to create a custom permalink
- corrupted URLs – can’t leave starting page
- rewrite based slug standar post wp
- Create different permalinks for same post
- remove SLASH on single_post but KEEP on categories and parent pages
- Multiple Taxonomy Items for Separate URLs
- Multiple URL rewrite rules and get every prams
- Using a template file for a specific custom URL
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- Redirect page to homepage, keeping URL
- Add slug to default post permalinks ONLY
- how to have same rewrite rules for 2 different post type?
- Permalink structure /page/page/cpt-post gives 404 with pagination
- What permastrusture tags are generated out of the box right after creating custom post types and taxonomies?
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- Two CPT: one is using part of the custom rewrite slug from the other
- Rewrite posts url as they’re all children of a page
- a way to support totally different url structure
- Multiple Permalink Patterns for one page
- Pretty Filter URL
- WordPress Pagination Custom Rewrite Rule for Pages
- rewrites and custom links in page need help with add_rewrite_rule
- Prevent guessing slug
- WordPress permalink still not working (error or not understood?)
- WordPress custom permalinks, pages are now 404
- Add additional URL variations for a Post
- Custom post permalinks for specific categories
- Permalinks, how to show them in post
- Single product link in woocomerce
- Post/page without slug
- Creating complex URLs with WordPress permalink structure
- permalinks url with woocommerce
- How to get the perfect WordPress, WooCommerce, Custom Post Type pretty permalinks?
- URL issues with WordPress
- Blog url disappears
- WordPress add parameters with friendly url structure
- Different template fallback when changing permalinks
- UI does not show correct Slug after modified using save_post action
- Custom post type Premalinks main page and details page
- Pages resolve at different URLs (different capitalizations)
- Standard Htaccess directives disappear by themselves
- ‘Unsupported Operand Types’ error stemming from taxonomy re-writes with PHP 8.1
- WordPress not remembering old slugs for pages
- What is the best way to relate different custom post types?
- Using a variable in page permalink
- make a new structure tag that does some processing
- How to make my custom permalink pull up the correct post