How to Add a Canonical Link Element to Concrete5
Adding a canonical link element to your Concrete5 website is actually pretty straight forward. What I’ve done is add a few simple lines of code to my header.php template file: <?php $url=Loader::helper(‘navigation’); $canonical=$url->getCollectionURL($c); $canonical=preg_replace(“/index.php\?cID=1$/”,”",$canonical); ?> <link rel=”canonical” href=”<?php echo $canonical; ?>” /> I wish I could take credit for this code, but I can’t – [...]
