I need foo-bar to become foo/bar instead:
//domain.com/foo-bar –> //domain.com/foo/bar
I expected this to be my solution, but I’ve tried every minor variation of this rule without success:
add_rewrite_rule( '^foo/bar', 'index.php?pagename=foo-bar', 'top');
I’m open to other solutions not using
I could accomplish this by creating a page with the slug “foo” and creating another page as a child of “foo” named “bar” but I’m trying to avoid creating empty pages.
Read more here: Custom Page Slug w/ add_rewrite_rule