How to fix URL segment conflict from page and post type URL?


I have two different pages like,

1 :- // Real Page
2 :- // Created by post type

Then i have changed second link URL to,

by using,

function nb_add_rewrite_rules( $rules ) {
  $new = array();
  $new['notebook/([^/]+)/(.+)/?$'] = 'index.php?nb_post_type=$matches[2]';
  $new['notebook/(.+)/?$'] = 'index.php?nb_post_taxo=$matches[1]';

  return array_merge( $new, $rules );
add_filter( 'rewrite_rules_array', 'nb_add_rewrite_rules' );

But due to this change my first page content is not displaying properly due to second segment notebook conflict.

How can this be solved?

Alex Brend 8 months 2020-11-27T08:10:20-05:00 0 Answers 17 views 0

Leave an answer