0

After logging out from the account the user is redirected to a page that redirects to the CMS home page of magento. I don't have that page and want to redirect to an external page instead. But I can't find a clean way to change that redirect url to a page outside of magento. I want to redirect to my page root whereas magento resides in https://www.mymagento.com/shop/. The redirect should lead to https://www.mymagento.com/.

1 Answer 1

6

Override the logout phtml template and update the redirect url.

vendor/magento/module-customer/view/frontend/templates/logout.phtml:14

Change the $block->getUrl() to the url where you want to be redirected.

$($.mage.redirect("<?php /* @escapeNotVerified */ echo $block->getUrl() ?>", "assign", 5000));
3
  • @DarsVaeda is the solution working for you?
    – Mike
    Commented Jul 14, 2017 at 11:00
  • Yep, not the cleanest solution though but at least it works. Thanks.
    – steros
    Commented Jul 17, 2017 at 9:02
  • How can we add an external URL? Commented Feb 2, 2023 at 6:42

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.