From a default Magento install you are provided with a default category (a root category) and this usually has category ID 2. How can I access the root category page using this as a URL: http://example.com/catalog/category/view/id/2. This always 404.

The reason for this is because I want to make this the homepage (without having to go do any CMS layout updates) using system config web/default/front as catalog/category/view/id/2.


As part of the category controller action Magento validates the category against the Mage_Catalog_Helper_Category function canShow().

This will return false against the check against isInRootCategoryList(). This function goes and checks the category's parent ids against the store root category id:

$rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
return in_array($rootCategoryId, $category->getParentIds());

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.