Question

when we get a 404 by going to something like www.yoursite.com/cowsaremyfriends you get the cms page that has been set as the 404 page in the backened

however, in the errors folder, there is a 404.phtml, what i've been tasked to do i set up the 404 page so that instead of it just being a dead end it's a bit more smarter like suggesting what page you might have been trying to go to

i am wondering how does this 404.phtml page gets called over the CMS one set in the backened as it would be easier to pull off what i am trying to do in that rather than a CMS page

Was it helpful?

Solution

You probably want to read Magento's Many 404 Pages. It outlines the various ways Magento can 404 on you, including the page you're talking about.

The short version: The 404 page in the errors folder (that's errors/404.php, which ultimately includes the 404.phtml file), will render if some piece of Magento code throws a Mage_Core_Model_Store_Exception exception, that exception is uncaught, and Magento isn't running in developer mode.

My quick untested way to achieve your goal would be to get your CMS 404 page to throw a Mage_Core_Model_Store_Exception.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top