Search code examples
rpackagecran

CRAN URL not in canonical form


I got a feedback from CRAN. ( After I tried to upload 0.2.1)

It said “CRAN URL not in canonical form” .

I don’t know which caused the URL has such problem, cause the previous 0.2.0 version doesn’t meet this problem.

Can anyone tell me in which part of the package do I need to make a change?

The CRAN feedback as below:

Found the following (possibly) invalid URLs:
   URL: https://cran.r-project.org/web/packages/gratis/index.html
     From: README.md
     Status: 200
     Message: OK
     CRAN URL not in canonical form

   URL: https://cran.rstudio.com/web/packages/gratis/index.html
     From: README.md
     Status: 200
     Message: OK
     CRAN URL not in canonical form


   The canonical URL of the CRAN page for a package is
     https://CRAN.R-project.org/package=pkgname

Solution

  • Canonical urls are used to solve problems arising from content duplication. For example the content of a web page may appear on several other web pages. Canonical urls inform search engines which copy of the web page should be displayed in search results. Canonical urls are indicated using the link HTML tag. For example the tag:

    <link href="https://moz.com/learn/seo/canonicalization" rel="canonical">
    

    Indicates that the url: https://moz.com/learn/seo/canonicalization is the master copy.

    For CRAN urls, the canonical url has the format: https://cran.r-project.org/package=package-name, where package-name is the name of the package. The bottom of the CRAN package page has a note indicating the canonical url.

    See this tutorial on canonical tags for more information.