Hi,
It's simple. Set the URL you prefer in the "canonical URL" setting of your product/category.
That way, search engines will reference only that one regardless of the one actually used by the customers to reach the product page and it won't flag the others as duplicate content.