I have different domains in a site in Drupal 7, which is multidomain and multilanguage, using modules Domain Access and i18n. I have duplicate content in some URLs accross domains, and I want to avoid Google penalization by following the recommendations of using
<head><link rel="canonical" href="CANONICAL_SOURCE_URL" />
I will use a custom module. For the nature of Drupal 7, I undestand that I can check each node, and using the
node->id and database call, to check the domains in which the node is active. Following an order of preferred domains, I will know that URL to set as the canonical.
Is that a good aproach? I have tried module MetaTag with Canonical, but it uses a wildcard approach so it repeats the domain in which I am, so we can have www.example.com/link1 and www.example.us/link1 as canonicals, when only one of them should be used.
How can I override MetaTag with my own link rel tag ?