A canonical URL is the URL of a webpage that search engines like Google consider to be the primary or "main" version of a page when there are multiple URLs with similar or duplicate content. This helps search engines understand which version of the page to index and display in search results, reducing issues related to duplicate content and improving the overall user experience. For example, a website might have the same content accessible through different URLs, such as:

  • https://example.com/index.php

  • https://www.example.com/index.php

or

  • https://www.example.com/home/

  • https://example.com/home/

In this case, the website owner would choose one of these URLs as the canonical URL and use a canonical tag in the HTML head of the other pages to point to the chosen canonical URL. This helps search engines understand that these pages are duplicates and that the canonical URL is the preferred version to be indexed and displayed in search results.