There are huge discussion what is better from a SEO perspective, having the category in the URL or not.
Magento creates a rewrite for each category the product is in. Turning on the Canonical URL
as @Dan suggested, avoids penalties for duplicate content.
The only "out of the box" way to have only one URL is, to turn category in URL off. (this is what I heard at the moment the recommended way, but I'm no SEO expert)
To have only one URL per product, you have to remove the category from the URL:
System > Config > Catalog > Catalog
> Search Engine Optimization > Use Categories Path for Product URLs: no
Answer on the comment
What I want, is the full categoriers path for every product, also if I click on recomended, you're telling me the complete opposite right now ;)
Yes, I did. To fix this I think you should still turn it off and change the indexer which writes the url rewrite, to use one (or the only) category of a product, so when a product url is requested from the url_rewrite, you get the one with the whole categories in it.
Best Answer
Id path is just a unique identifier for the url rewrites. It has no actual logic in the redirect itself.
It is useful so you can mark certain rewrites for later use in the code.
For example, the urls generated for product pages have the id path
product/{product_id_here}
.This way you can identify the product url rewrite via code.
It is also useful if you add your own module that writes entries to the
url_rewrite
table. You can later retrieve them via code.But an url rewrite will work even if the id path does not mean anything.
The only constraint is that it has to be unique per store view.