custom rewrite rules will not be added to wordpress rewrite_rules database
custom rewrite rules will not be added to wordpress rewrite_rules database
custom rewrite rules will not be added to wordpress rewrite_rules database
If you want a rewrite rule that loads a post type archive from a different URL, the simplest way is via an internal rewrite, which doesn’t get inserted into .htaccess. Internal rewrites map URLs to query arguments, and must result in a successful main query: add_rewrite_rule( ‘some_url/?$’, ‘index.php?post_type=yourcpt’, ‘top’ );
For anyone looking, the solution was: add_action(‘init’, function() { add_rewrite_rule( ‘product/(.*)/(.*)/?’, ‘index.php?product=$matches[1]&view=$matches[2]’, ‘top’ ); });
You can use a rewrite endpoint for this. The first step is to give your custom taxonomy an endpoint mask when you register the taxonomy: $args = [ ‘rewrite’ => [ ‘slug’ => ‘topic’, ‘ep_mask’ => EP_CATEGORIES ], // the rest of your args… ]; register_taxonomy( ‘topic’, array( ‘post’ ), $args ); The next step … Read more
Prefix only some posts with a custom prefix
Rewrite url for custom post type with specific url
It’s the redirect in htaccess that will route the “pretty” url into the real querystring based url that is the issue. So, it would seem you need to “remove” the /{nicename} portion from the “pretty” URL of the form https://example.com/members-list-profile/{nicename}/?uid=XX. Try something like the following at the top of your .htaccess file (before the WordPress … Read more
Issue with custom rewrite for products and permalinks
Rewrite rule not working, suspect redirect string
Your taxonomy is set to ‘hierarchical’ => true, do you have the post included in both the parent and child category? If you untick the parent category and only tick sub-category then it should use the first URL only.