Skip to content

Commit

Permalink
Merge pull request #99 from adpeate/master
Browse files Browse the repository at this point in the history
remove page key in canocical for home page
  • Loading branch information
adampmoss authored Feb 2, 2017
2 parents 82154d9 + b273515 commit 9bbac94
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ class Creare_CreareSeoCore_Block_Page_Html_Head_Cmscanonical extends Mage_Core_B
public function getCanonicalUrl()
{
$cmsPagePath = Mage::getSingleton('cms/page')->getIdentifier();
$canonicalUrl = Mage::getBaseUrl().$cmsPagePath;
$isHomePage = $this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true));
if($isHomePage){
$canonicalUrl = Mage::getBaseUrl();
} else {
$canonicalUrl = Mage::getBaseUrl().$cmsPagePath;
}
$protocol = $this->creareseoHelper()->getConfig('cms_canonical_protocol');

$canonicalUrl = str_replace(
Expand Down

0 comments on commit 9bbac94

Please sign in to comment.