Same page has 2 different URLs
-
Hi guys,
I’m using this rule for a custom post type:
add_action( 'init', 'rewrite_glossary_permalinks' ); function rewrite_glossary_permalinks() { register_post_type( 'glossary', array( 'label' => 'Glossary', 'public' => true, 'has_archive' => false, 'show_in_menu' => 'cmtt_menu_options', 'show_in_rest' => true, 'rest_base' => 'glossary', 'rewrite' => array( "with_front" => true, 'slug' => 'guides' ), 'cptp_permalink_structure' => '/%glossary-categories%/%postname%' ) ); }
If I set an initial taxonomy value for the %glossary-categories% and then I change that to a new one, I will end up having 2 URLs for the same post. Both URLs are working and pointing to the same post, but I only need one to work (the latter).
Example:
http://www.websitename.com/guides/parent_category/child_1_category/postname
http://www.websitename.com/guides/parent_category/child_2_category/postnameI have updated the permalinks (cleared transients), etc. But it seems nothing has any effect on this.
Do you have any suggestions?
- The topic ‘Same page has 2 different URLs’ is closed to new replies.