Skip to content

Instantly share code, notes, and snippets.

@herveguetin
Created May 26, 2014 22:54
Show Gist options
  • Select an option

  • Save herveguetin/6fb8727e73d789ea8d5e to your computer and use it in GitHub Desktop.

Select an option

Save herveguetin/6fb8727e73d789ea8d5e to your computer and use it in GitHub Desktop.
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