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

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

1 Answer 1

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 and acknowledge you have read our privacy policy.

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