How to remove direct product url from magento? for example
Instead of http://example.com/product1.html All product url should have category name in path.
Note: I dont want to access product with direct link. I m aware that we can add category path in product url with enabling below settings.
Store -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> "Use Categories Path for Product URLs" set to "Yes"