Canonical URLs
Canonical URLs tell search engines which address is authoritative for a page; important when the same content could be reached under slightly different URLs. Chinaski handles canonicals at three levels: your site URL, automatic per-page values, and hand-picked overrides. This page explains each.
Your site URL comes first
Everything canonical starts with the Site URL setting. Chinaski builds every canonical address from it, so getting it right is step one: set it once (for example https://example.com) and pick your preferred spelling, including whether to use www..
For multi-language sites, the effective base adapts to your language URL mode. In subdomain mode (es.example.com), each language’s canonical URLs are rewritten to its own language subdomain automatically.
With no Site URL set, no canonical URLs are emitted at all; nothing absolute is invented.
Automatic canonicals on every page
When a page doesn’t have a custom canonical URL, Chinaski computes one automatically:
- Pages get their own public address (including any parent-page path).
- Posts get their full blog address (including the blog prefix, such as
/blog/). - Blog and category listings get per-page canonicals: page 2 of the blog points at page 2’s address, not at the blog’s first page, so paginated pages don’t fight each other in search.
- The documents index canonicalizes to its own section address.
- Old URLs that have redirects also carry a canonical tag pointing at the destination, which is how search engines treat the moved page correctly.
Every rendered page then outputs the canonical twice in its meta tags: as the <link rel="canonical"> tag, and as the OpenGraph og:url property used by social platforms.
Overriding a canonical for one page
If you syndicate content, publish a mirrored version, or otherwise need a page to credit another address, fill in the Canonical URL field in the page or post editor’s SEO section. What you enter there wins: the builder uses your value verbatim instead of the automatically computed one. Leave it empty in normal circumstances: the automatic value is already correct.
Enforcing one domain host
Canonical tags tell search engines what you prefer; redirects force it. On every build, Chinaski writes a rule into the site’s redirect file that sends the non-canonical spelling of your host to the canonical one: www.example.com → example.com (or the reverse, depending on your Site URL setting), permanently (301) and preserving the requested path. The rule is rewritten cleanly on each build so it never accumulates duplicates, and the build log reports whenever the enforcement block was written.
One hosting caveat: this domain rule is written to the Netlify-format _redirects file, which hosts and gateways that read that format can enforce at the server. The Caddy-format export file does not include it; on those setups the enforcement is at the page-tag level and, should you want a hard redirect, you add a host rule to your own Caddyfile.
Practical guidance
- Set the Site URL once, early. Everything absolute (canonicals, social URLs, sitemap addresses) derives from it.
- Don’t override canonicals casually. The automatic value is correct for every ordinary page; use the override field only when the content genuinely exists at another URL (syndication, aggregators).
- One frame of reference: a canonical points pages outward to other sites or across domains of yours; for pages that never left your site, leave the field blank and let the automatic canonical do the work.