2016-09-06 55 views
0

我有一个博客用Photoshop教程和因为一些我的教程是相当长的,我决定分家的内容分成部分如何设置2部分博客条目的规范URL?

http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx 

http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?part=2 

canonical相对的两个页面设置为

http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx 

这是否比有2个规范链接的选项更好?请注意,我在我希望编入索引的两个部分都有图像和文字。

回答

0

在这种情况下,不允许使用链接类型canonical

RFC 6596 defines

目标(规范)IRI必须标识内容要么是重复或在上下文中(指)IRI的内容的超集。

但是您的第二页不包含在(或与第一页相同)。

所以,你有以下这些选项:

  • 引入包含整个内容的页面,使这一个canonical目标为所有分页页面(但如果你这样做,你可能要考虑停止首先提供分页版本)。请注意,只有分页don’t have separate user comments(或任何其他独特内容)才允许使用。
  • 使用self-referentialcanonical目标。
  • 忽略canonical
0

您可以使用规范的分页的解决:

  1. 在第一页的<head>部分(www.psd-dude.com/tutorials/how-to-make-a-咖啡渍文本功能于photoshop.aspx), 添加一个链接标签指向下一个页面序列中,像这样的:

    <link rel="canonical" href="http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx"> 
    <link rel="next" href="http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?part=2"> 
    

    因为这是序列中的第一个URL,就没有必要为rel =“prev”添加标记。

  2. 在第二和第三页上,添加指向序列中前一个和下一个URL的链接。例如,可以添加如下处理序列的第二页:

    <link rel="prev" href="http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx"> 
    <link rel="canonical" href="http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?part=2"> 
    <link rel="next" href="http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?part=3"> 
    
  • 在序列的最后一页(www.psd- dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?部分= 4>),添加指向先前的URL的链接,就像这样:

    <link rel="prev" href="http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?part=3"> 
    <link rel="canonical" href="http://www.psd-dude.com/tutorials/how-to-make-a-coffee-stain-text-in-photoshop.aspx?part=4"> 
    

    因为这是序列中的最后一个网址,因此无需添加一个rel =“下一个”链接。