Best SEO practice dictates that duplicate content, the same content found on multiple pages of one domain, is widely frowned upon. Most of the time, duplicate content is unintentional, either due to a lack of knowledge of its destructive consequences or just out of blatant disregard.
That being said, there are times when you do need duplicate content on your website. Consider an ecommerce site, particularly a product catalog, for example.
In a product catalog, it is not uncommon for the same product to be associated with multiple categories. For this very reason you could possibly have the same content on multiple URLS…
… which will all show the product details for one specific product. Now ideally we want search engines to only index one of those pages and ignore the other two. Fortunately, Google, Bing and a few other search engines, allow us to circumvent this problem rather easily by using the canonical link element. The canonical link element, which is put in the HEAD section of an HTML document, tells search engines the preferred location for a particular URL. So in order for the search engines to ignore two of the pages from our example above, and only pay attention to the page we want indexed, the following line can be added to both pages we do not want indexed:
<link rel="canonical" href="http://domain.com/category/product.html"/>
Now when the search engines visit the pages with that element, they will only consider its canonical location in their indexes. It should be noted however, that you should still avoid duplicate content at all costs, but there are some times when your application truly needs it, and for this, the canonical link element is perfect.