I'm new on Magento. I don't know what happen with the url of sub category on Magento.

When on www.wow.ng/customer/account/login/ OR www.wow.ng/catalogsearch/result/ OR www.wow.ng/checkout/cart/ I can only link to category or product page but I cannot link to subcategories. This is how it links to subcategories www.wow.ng/checkout/cart/food-drinks.html which gives a 404 error page. Clearly the page URL is not correct. The correct URL is www.wow.ng/food-drinks.html but Magento does not remove the checkout/cart OR catalogsearch/result from the url. Hope you guy can help me to fix this problem.

I am using Magento ver.

Any question please feel free to ask. Thank you

  • How are you building the URLs of sub-categories ?
    – Prateek
    Commented Nov 21, 2015 at 9:05
  • Also posted on SO
    – unor
    Commented Nov 21, 2015 at 23:17

1 Answer 1


It looks like your category links are relative. Your links should look like this:

<a href="/food-drinks.html">


<a href="food-drinks.html">

Magento give us a function to handle links:

<a href="<?php echo $this->getUrl('food-drinks.html') ?>

This will append the whole url and any parameters needed.

Ideally, you would get the URL from the category object encase the URL changes.

If you add some code snippets I could probably advise further. Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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