I try to create categories with the following code in a data-upgrade script. The categories where stored in the database but the seo-urls are not working.

Instead of {HOST}/categoryA/categoryB the url is like {HOST}/catalog/category/view/s/categorB/id/152/

/** @var Mage_Catalog_Model_Category $rootCat */
$rootCat = Mage::getModel('catalog/category');

/** @var Mage_Catalog_Model_Category */
$category = Mage::getModel('catalog/category');

Any ideas?

Thanks in advance!

  • 1
    Did you tried reindexing?
    – mbalparda
    Oct 17 '14 at 13:41
  • are you sure all the URL rewrite modules are activated? (Apache and Magento) Oct 17 '14 at 14:00
  • @mbalparda It works after reindexing. Why is it necessary?
    – chmoelders
    Oct 17 '14 at 14:58
  • The reindex process updates the URLs as far as i know. I added an answer to this, please mark it as accepted so we can resolve this question.
    – mbalparda
    Oct 17 '14 at 15:45

After inserting the category reindex the indexes and that should fix your issue. You can add a reindex to your code also.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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