Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add canonical URL to Magento <head>
<?php
$canonicalUrl = Mage::getBaseUrl(); // your logic...
$this->getLayout()
->getBlock('head')
->addLinkRel('canonical', $canonicalUrl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment