来自谷歌的recommendations for URL structure :
Sorting parameters. Some large shopping sites provide multiple ways to sort the same items, resulting in a much greater number of URLs. For example:
http://www.example.com/results?search_type=search_videos&search_query=tpb&search_sort=relevance&search_category=25
"
当从外部链接时,只在排序参数上有所不同的 URL 显然不是一个好主意:Google 不会理解这些链接指向同一项目,即该项目很受欢迎。因此排名将低于应有的水平。
但是有什么选择呢?使用片段标识符 (#),然后在 JavaScript 中进行排序?还有什么?网站站长工具中的一些设置?
最佳答案
您可以在此处将 link
元素与 rel="canonical"
一起使用。
It's common for a site to have several pages listing the same set of products. For example, one page might display products sorted in alphabetical order, while other pages display the same products listed by price or by rating. For example:
http://www.example.com/product.php?item=swedish-fish&trackingid=1234567&sort=alpha&sessionid=5678asfasdfasfd
http://www.example.com/product.php?item=swedish-fish&trackingid=1234567&sort=price&sessionid=5678asfasdfasfd
If Google knows that these pages have the same content, we may index only one version for our search results. Our algorithms select the page we think best answers the user's query. Now, however, users can specify a canonical page to search engines by adding a
<link>
element with the attributerel="canonical"
to the<head>
section of the non-canonical version of the page. Adding this link and attribute lets site owners identify sets of identical content and suggest to Google: "Of all these pages with identical content, this page is the most useful. Please prioritize it in search results."
好处:
关于http - 谷歌说 : Sort parameters in URL problematic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12971683/