Pregunta

I inherited an older website with a separate mobile and tablet directory. Both of them have duplicate content of the desktop version. Both the mobile and tablet versions are using JQuery Mobile and are one pagers with data roles for "pages."

A desktop page named awards.html will look like this on the mobile and tablet version:

<div data-role="page" id="awards">

On the desktop pages, I'm adding to the head tag:

<link rel="alternate" media="only screen and (max-width: 480px)" href="http://www.example.com/mobile/#awards"/>"
<link rel="alternate" media="only screen and (max-width 768px) and (min-width 481px)" href="http://www.example.com/tablet/#awards"/>"

My question is, on the mobile and tablet version, how do I add the canonical tag since the the whole site is on one index and they share the head tags? Where would I put this?

<link rel="canonical" href="http://www.example.com/awards.html" />
¿Fue útil?

Solución

The canonical url link can be placed on every page. Having it self-referential on the desktop page is fine.

Just add that canonical in the shared <head> template for mobile, tablet and desktop.

For more info Use canonical URLs

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top