You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core/canonical: flag non-home pages whose canonical points at the homepage #1685
A template that hard-codes the canonical URL to the site root tells search engines that every page is a duplicate of the homepage. The pages then drop out of the index. core/canonical checks that a canonical exists and is valid, but it passes this case because the URL is well formed.
Proposal
Add a canonical-to-homepage check to core/canonical. It fails when a page that is not the homepage declares the site root as its canonical.
Acceptance Criteria
A page at any path other than the site root whose canonical resolves to the site root fails canonical-to-homepage as an error, and the finding shows the page URL and the canonical.
The homepage with a self-referencing canonical passes.
Root variants that the site treats as the homepage (trailing slash, /index.html, the www and non-www form of the same host) are not flagged for pointing at the root.
A locale homepage such as /en/ that canonicals to / is reported as a warning, not an error.
A page that redirects to the homepage is not flagged by this check.
The canonical from the Link header is treated the same as the tag.
Pages with a canonical to any other URL get the same result as before this change.
The docs page for core/canonical describes the new check.
Activity
fix(rules): core/canonical treats index.php, index.htm, index.asp(x) …
fix(rules): core/canonical treats /home, /home/, /index and /home.<ex…
feat(rules): core/canonical flags a page whose canonical points at th…
fix(rules): core/canonical treats index.php, index.htm, index.asp(x) …
fix(rules): core/canonical treats /home, /home/, /index and /home.<ex…