Two canonicals that refuse to agree

The head points at one canonical. The header points at another. The search engine ends up trusting neither.

Two canonicals that refuse to agree, an illustrative diagram

Two answers on one page

A page can declare its canonical in two places: a link tag in the HTML head, or a Link header on the HTTP response. Search engines look at both. When the two answers differ, as they do right here, neither one survives. The search engine discards them and chooses a canonical by itself, and its pick is rarely the one you wanted.

Say it once

Declare the canonical once and keep it steady. Nearly every site should use the head tag and never send the header. When a Link-header canonical shows up that you did not ask for, a CDN or a framework is usually the source. Either bring the header in line with the head tag or delete it, and the page has one clear answer to give.