According to this article http://alanstorm.com/magentos_many_404_pages/ there is three 404 pages in Magento: 1 The one dispatched by the apache 2 CMS page 3 Generated via layout XML

If I need to create my own distinct 404 page, that has different design from default Magento 404, the best way is probably 'Adding custom Layout XML Updates to the handles cms_index_noroute and cms_index_defaultnoroute', right?

What I did:

1 New module

2 <frontend> <layout> <updates> <mine_eshop> <file>mine/eshop.xml</file> </mine_eshop> </updates> </layout> </frontend>


    <remove name="right"/>
    <remove name="left"/>

    <reference name="content">
        <block type="core/template" name="mine_no_route" template="mine/404.phtml"/>

And now I got my custom template right below the default one. And this is inside default Magento page layout.

There was no 404 CMS page configured or found.

New 404

How to display only the custom 404.phtml on the page in case of that error? They say there is no 'right' way to do it and it is pretty frustrating. What are the best practices of creating a custom error pages?

2 Answers 2


You can change it via configuration but if you want to replace the template file then I would do it via local.xml instead.

Create local.xml if you don't have in your theme's layout folder and add this:

<?xml version="1.0"?>
<layout version="0.1.0">
     <reference name="default_no_route">
         <action method="setTemplate">

This will replace the template for no route AKA 404 page. I haven't tested but should work. Good luck.


You can just customize the default '404 Not Found' page under CMS -> Pages in your Magento admin. If it's not there, create a new cms page and select it in System -> Configuration -> General -> Web -> Default Pages -> CMS No Route Page.

  • This will give me a poor CMS page surrounded by a default Magento page layout. And I need an entirely new page. May 16, 2017 at 11:31

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.