: What should I use for a canonical URL for a search page that has a few search options? I read this post here: What is a best canonical URL for a search result page? and I have search page
I read this post here: What is a best canonical URL for a search result page?
and I have search page which can set more than one item like this:
example.com/search/index.php?keywords=fruits_bananas_apples
Which would be better for a canonical URL:
example.com/search/index.php
or
example.com/search/index.php?keywords=fruits_bananas_apples
More posts by @Annie201
2 Comments
Sorted by latest first Latest Oldest Best
In general it might be a good idea to block crawling of search result pages, but there are cases where it can makes sense to allow crawling.
For example, if your search is the only or the primary way to navigate the site, and especially if you offer filters (or search operators) with pre-defined search terms. So instead of having a separate /category/ namespace (e.g., /category/movies), some sites use the search function for this: /search/category:movies.
And besides that: Even if you disallow crawling of search result pages, it can still make sense to provide the canonical link type for these pages (all kinds of tools might use it, e.g., for bookmarking).
So here’s an answer to the original question:
It would be wrong to use example.com/search/index.php as canonical URL for example.com/search/index.php?keywords=fruits_bananas_apples.
RFC 6596 makes clear that the canonical URL
[…] MUST identify content that is either duplicative or a superset of the content […]
As /search/index.php does (most likely) not contain or include the content from /search/index.php?keywords=fruits_bananas_apples, it’s not allowed to be specified as canonical URL.
A case where it would be appropriate for a search result to use the canonical link relation (just as an example to give you an idea, probably not worth to implement this one): Assuming that the order of the search terms does not matter, you could decide to use the URL with the search terms in alphabetical order as canonical URL, e.g.,
/search/index.php?keywords=apples_bananas_fruits
for URLs like
/search/index.php?keywords=apples_fruits_bananas
/search/index.php?keywords=fruits_bananas_apples
…
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.