I'm having some problems to set up a canonical link between 2 websites. I have one website, www.z-yachting.com and the second www.golf-estates.com.
Z-yachting.com is the leading website, so golf-estates.com needs to have a canonical tag that refers to the articles on z-yachting.com. The structure of both sites is exactly the same. I don't know how to add a canonical tag that dynamically loads the link to the other website.
I tried this:
But in this case the category isn't included, so the link isn't correct. How to solve this? I hope someone can help me.<link rel=”canonical” href=”http://www.z-yachting.com<?php echo $link = JRoute::_( 'index.php?lang='.$languages[ $code ]->sef.'&Itemid='.$item->id ); ?><?php echo $active->alias ?>” />