Page not found taxonomy custom post type

I made a custom post type with taxonomies and when I go to the taxonomy page and view one of the taxonomies I get a page not found error like the taxonomy wasnt made.

Any suggestions?

/*Products*/
$labels = array(
    'name' => _x('Products', 'post type general name'),
    'singular_name' => _x('Product', 'post type singular name'),
    'add_new' => _x('Add New', 'Product'),
    'add_new_item' => __("Add New Product"),
    'edit_item' => __("Edit Product"),
    'new_item' => __("New Product"),
    'view_item' => __("View Product"),
    'search_items' => __("Search Product"),
    'not_found' =>  __('No products found'),
    'not_found_in_trash' => __('No products found in Trash'), 
    'parent_item_colon' => ''
  );

$args = array(
    'labels' => $labels,
        'singular_label' => __('Products'),
        'public' => true,
        'show_ui' => true,
        'capability_type' => 'post',
        'hierarchical' => false,
        'rewrite' => true,
        'query_var' => 'products',
        'taxonomies' => array('products-cat'),
        'supports' => array('title', 'editor', 'custom-fields', 'thumbnail', 'excerpt'),
        'has_archive' => true,
);
register_post_type( 'products' , $args );

// Add to admin_init function
add_filter('manage_edit-products_columns', 'add_new_products_columns');
function add_new_products_columns($columns) {
$columns = array(
    'cb' => '<input type="checkbox" />',
        'images' => 'Images',
    'title' => 'Product Name',
        'author' => 'Author',
        'product-categories' => 'Categories',
        'tags' => 'Tags',
        'date' => 'Date',
); 
    return $columns;
}

add_action('manage_products_posts_custom_column', 'manage_products_columns', 10, 2);

function manage_products_columns($column_name, $id) {
    global $wpdb;
    switch ($column_name) {

    case 'images':
            //echo get_the_post_thumbnail( $page->ID, array(50,50) ); 
    break;

    case 'product-categories':
        echo get_the_term_list($post->ID, 'products-cat', '', ', ','');
    break;

        default:
        break;
    } 
}

add_action( 'init', 'products_create_taxonomies', 0 );

function products_create_taxonomies() 
{
    // Photo Categories
    register_taxonomy('products-cat',array('products'),array(
        'hierarchical' => true,
        'label' => 'Product Categories',
        'singular_name' => 'Products Category',
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => array('slug' => 'products' )
    ));
}

/*End Products*/

I have this in my archives page

archive-products.php

<?php get_header(); ?>

<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post();?>
                <?php the_title(); ?>   
<?php endwhile; endif; ?>

Solutions Collecting From Web of "Page not found taxonomy custom post type"

I encountered the same problem on my local nginx platform.
After I updated permalinks in the settings, everything worked fine.
Settings > Permalinks > Save Changes (without modification)

After some research I have found a blog who actually had an answer to this problem.

Here is the function along with the blog url.

function taxonomy_slug_rewrite($wp_rewrite) {
    $rules = array();
    // get all custom taxonomies
    $taxonomies = get_taxonomies(array('_builtin' => false), 'objects');
    // get all custom post types
    $post_types = get_post_types(array('public' => true, '_builtin' => false), 'objects');

    foreach ($post_types as $post_type) {
        foreach ($taxonomies as $taxonomy) {

            // go through all post types which this taxonomy is assigned to
            foreach ($taxonomy->object_type as $object_type) {

                // check if taxonomy is registered for this custom type
                if ($object_type == $post_type->rewrite['slug']) {

                    // get category objects
                    $terms = get_categories(array('type' => $object_type, 'taxonomy' => $taxonomy->name, 'hide_empty' => 0));

                    // make rules
                    foreach ($terms as $term) {
                        $rules[$object_type . '/' . $term->slug . '/?$'] = 'index.php?' . $term->taxonomy . '=' . $term->slug;
                    }
                }
            }
        }
    }
    // merge with global rules
    $wp_rewrite->rules = $rules + $wp_rewrite->rules;
}
add_filter('generate_rewrite_rules', 'taxonomy_slug_rewrite');

I’d recommend at least two things:

  1. Change the priority for your products_create_taxonomies action to at least 1, if not 5 or higher. (I’m thinking 0 is not valid for action priorities for some reason)

  2. Add your post type creation into an init action just like you did your taxonomies at an earlier priority than your taxonomy (since you are connecting them via the taxonomy).

If those two changes don’t take care of it, try setting up both (without linking them via their own structures) and then call the following on a later priority (still during init):

register_taxonomy_for_object_type( 'products-cat', 'products' );

That should make sure that they are fully and properly linked up.

I think your main issue here is the rewrite for your taxonomy. As it stands, your rewrite for the taxonomy looks like this

'rewrite' => array('slug' => 'products' )

This is what exactly what this rewrite means in your custom post type. The following

'rewrite' => true,

translates to this in your custom post type

'rewrite' => array('slug' => 'products' )

By default, this clash in rewrites will 404 your taxonomy requests. As a solution, you can change your rewrite for your taxonomy, or have a look at this post I have done recently on this site on a better workaround to this.

Important: Flush your permalinks after every update in your code to reset your permalinks to your new structure