SEO:分页使用rel=“next” 和 rel=“prev”

  类似 rel=”canonical” 是用来标记重复内容,现在网站webmaster可以使用HTML的link元素 rel=”next” and rel=”prev” 来表示分页的多个页面之间是上下页的关系,这样对于Google等搜索引擎来说能够判断分页多个页面之间的关系。

假设你有多个页面网址如下:

http://www.example.com/article?story=abc&page=1
http://www.example.com/article?story=abc&page=2
http://www.example.com/article?story=abc&page=3
http://www.example.com/article?story=abc&page=4

这是你的4个页面分页,为了表达这四个页面之间的分页关系,首先在第一个页面http://www.example.com/article?story=abc&page=1的HTML头部<head>加入如下:

<link rel="next" href="http://www.example.com/article?story=abc&page=2" />

这表示第一页的下一页是http://www.example.com/article?story=abc&page=2,那么在第二页的<head>加入如下标记:

<link rel="prev" href="http://www.example.com/article?story=abc&page=1" />
<link rel="next" href="http://www.example.com/article?story=abc&page=3" />

这表示当前第二页的上一页和下一页指向的页面url;

在第三页, http://www.example.com/article?story=abc&page=3:

<link rel="prev" href="http://www.example.com/article?story=abc&page=2" />
<link rel="next" href="http://www.example.com/article?story=abc&page=4" />

在最后一页http://www.example.com/article?story=abc&page=4:

<link rel="prev" href="http://www.example.com/article?story=abc&page=3" />

注意点如下:

  • 第一个页面只能包含 rel=”next” 不能有 rel=”prev”.
  • 从第二页开始到最后一页之前都必须同时有 rel=”next”和 rel=”prev”
  • 最后一页只能有rel=”prev”, 不能包含 rel=”next”.
  • rel=”next” 和 rel=”prev” 值应该是相对或绝对路径
  • rel=”next” 和 rel=”prev” 只能用在<head>中,不能用在<body>中.

为了在搜索引擎直接显示你页面的分页,现在可以使用这两个标记了。

 

30种Bootstrap免费响应式设计模板