I would like to use the “Use Categories Path for Product URLs” feature within Magento 2 however default to it. Not only that but in the case a product belongs to multiple categories be able to set the default path to include a “Master” category.
By default the sitemap seems to generate basic urls like domain.com/product.html. And even when “Use Categories Path for Product URLs” is set to enabled the products are accessible from other urls. I want to achieve domain.com/master-category/product.html as the only route to that product if possible.
Not sure the best route to achieve this weather it be a module that creates redirects based on master categories and generates URLS redirects accordingly and then similarly mods the sitemap generation to include these URLS or if there is an easier route e.g default settings or recommended module?