Custom plugin WordPress with Permalink
<p>I'm programming my own plugin using WordPress the plugin has Categories and sub categories with Taxonomy. The problem is in the URL of my website for exemple when i'm the single page of the plugin the URL is like mywebsite.com/products/name-of-the-product and when i'm the category page the URL is like : mywebsite.com/categories. </p>

<p>How can i have the same url for all pages i want to have this structure in my permalink mywebsite.com/categories/subcategory/name-of-the-product</p>

<p>Thank you</p>