1つのウェブページに複数のURLが存在する場合があります。
例2
これらにアクセスした場合、同じウェブページが表示されるのに、URLが異なります。
そこで必要となるのが、URLの正規化、canonical(カノニカル)です。
canonicalは、head内で指定します。
rel="canonical"
属性と <link>
要素< html > < head > < link rel = "canonical" href = "https://example.com/page.php" /> < body >
rel="canonical"
リンク要素では、相対パスではなく絶対パスを使用します。適切な構造:
https://www.example.com/dresses/green/greendresss.html
不適切な構造:
/dresses/green/greendress.html