0

I am having problem with my magento store. My links are not working properly...

My page links are like

for CMS pages

localhost/about-us

localhost/contact-us

and for category page

localhost/my-category

for product page

localhost/my-category/my-product

now problem is... when I try to redirect from localhost/my-category/my-product this link to Another cms page it suppose to redirect to localhost/about-us this, But it is actually redirecting to localhost/my-category/about-us

where will be the problem?It is only happening with CMS pages

  • From where are you adding links to your website? I mean from admin panel or from any file? – Mohit Kumar Arora Mar 20 '17 at 12:22
  • I am using Mega menu plugin for it. it automatically gets links – parish Mar 20 '17 at 12:27
  • Means you are putting only "about-us", "contact-us" etc. as links in menu from admin panel? – Mohit Kumar Arora Mar 20 '17 at 12:38
  • Yes correct. I am using only links which i gave it in the CMS page setting – parish Mar 20 '17 at 12:43
  • Now when i go to product-page all pages links gets that product category name in the link – parish Mar 20 '17 at 12:44
0

First you get the url of cms page

$url= Mage::helper('cms/page')->getPageUrl('url_key');

Then try below code to redirect

$this->_redirect($url)

OR

Mage::app()->getFrontController()->getResponse()->setRedirect($url); 

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.