Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

We have following category and sub-category in our store.

Category: http://mysite.com/category.html

Sub-category: http://mysite.com/category/sub-category.html

Is it possible to access sub-category listing page using below URL

Sub-category: http://mysite.com/sub-category.html

Case 1 : Access sub-category listing page, even if its main category id disabled

Case 2: Access sub-category listing page without using main category in URL

Also if my product is assigned to any sub-category and set the visibility to Catalog, will it appear on sub-category listing page when its category id disabled ?

How can I achieve this ?


share|improve this question

3 Answers 3

we made this extension to do it


Up+1 if you like it

share|improve this answer

In Admin:

Admin -> System -> Config -> Catalog -> Search Engine Optimizations -> Use Parent Category Path for Category URLs (set to NO)


Open the class Mage_Catalog_Model_Url and comment the below line

//if (null === $parentPath) {
//    $parentPath = $this->getResource()->getCategoryParentPath($category);
//elseif ($parentPath == '/') {
    $parentPath = '';

under function getCategoryRequestPath($category, $parentPath)

You can always create a local of your file, just in order to avoid over riding the core files

share|improve this answer

i can recommend you to try below default function

Remove parent category path from url and change it from

http://mysite.com/category/sub-category.html to http://mysite.com/sub-category.html


Go to the Magento Admin Panel -> System -> Configuration -> Catalog -> Seo Options

Select yes or no from "Use Parent Category Path for Category URLs"

Refresh category url index

Option YES => http://mysite.com/category/sub-category.html

Option NO => http://mysite.com/sub-category.html



you can try to rewrite url for category. hope this could be work for you. i am not 100% sure about this modle url rewrite in magento1.7

Hope this will sure help you.

share|improve this answer
Thanks for your response. See my updated question. –  Lazar Jun 26 '14 at 7:10
Liyakat is right. –  Amit Bera Jun 26 '14 at 7:24
@AmitBera, Thanks –  liyakat Jun 26 '14 at 10:30
@liyakat, Use Categories Path for Product URLs set to yes. Can not see the option you said i.e. 'Use Parent Category Path for Category URLs'. Version is –  Lazar Jun 26 '14 at 12:32
What should I do if I see no such option in my Mage admin ? –  Lazar Jun 27 '14 at 4:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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