Rewrites with hierarchical taxonomies in permalink

I am attempting to create a hierarchical list of products in WordPress 3.5.1. For example if the custom post type product was in the custom taxonomy Outdoor > Garden Tools > Hoses, these would be the desired permalinks:

/outdoor/garden-tools/hoses/mega-hose/ (loads the single.php template)

Read More

/outdoor/garden-tools/hoses/ (loads the archive.php template)

What is the best practice approach to achieving this?

I have generated the permalinks with all multiple levels of parent categories successfully for the posts and terms using the post_type_link and term_link filters respectively. There appears to be a problem with the URL rewriting though as the permalinks return 404 responses, I can’t seem to figure out how these requests are functioning (where “xx” can be any string):

/xx/mega-hose/ (returns mega hose page)

/xx/xx/mega-hose/ (redirects to /outdoor/garden-tools/hoses/mega-hose/ and returns a 404)

Any help would be much appreciated!

Related posts