0

This question already has an answer here:

Google has indexed two versions of site's homepage like below. Is there any URL rewrites requires to be added to fix this? Appreciate assistance.

www.abc.com www.abc.com/home

marked as duplicate by sv3n, Prince Patel, Siarhey Uchukhlebau, liyakat, brentwpeterson Aug 13 '17 at 15:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Need to rewrite the model file app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php

Replace bellow function from

protected function _prepareObject(array $data)
{
    $object = new Varien_Object();
    $object->setId($data[$this->getIdFieldName()]);
    $object->setUrl($data['url']);

    return $object;
}

to

protected function _prepareObject(array $data)
{
    $object = new Varien_Object();
    $object->setId($data[$this->getIdFieldName()]);
    //for home set url to ''
    if ($data['url'] == 'home') {
        $data['url'] = '';
    }
    $object->setUrl($data['url']);

    return $object;
}
  • If you want this, don't actually change the file but create a custom extension to override this single method. You don't want core hacks. – Arjen Miedema Jan 16 '16 at 13:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.