Magento Enterprise 1.9.0.0 redirects to home page instead of 404 error page

Featured Image

If you have installed and working on latest Magento’s Enterprise Edition 1.9.0.0, you could find some strange behavior with 404 error page and landing page. People say there is a patch for this, but I would like to present a quick fix for those of you who need an urgent solution. Issue is that you’ll get status 200 OK for each non-existing CMS page or controller and you will be redirected to home page.

Bug is in class Mage_Core_Controller_Varien_Router_Default, at line 42. Do not edit this core file, since it’s Magento Enterprise Edition!
Solution is to:

  • create folders “Mage\Core\Controller\Varien\Router\” in yours “app\code\local\” folder
  • copy source file “Default.php” from “app\code\core\Mage\Core\Controller\Varien\Router\” into your local folder
  • update the line 42:
$actionName = isset($noRoute[1]) ? $noRoute[1] : 'index';

– and replace with:

$actionName = isset($noRoute[2]) ? $noRoute[2] : 'index';

Enjoy coding.


13 comments

  1. Hi Vedran

    I donโ€™t know much about 404 error pages because I had started my blogging career recently.

    But somewhere I read that If any blogger or writer deleted the existing web page then the URL of that web page becomes 404 URL and that page becomes 404 page.

    It is also said that Google donโ€™t like 404 page so I checked my site whether I had any 404 page or not then I found few of the 404 error pages on my site also.

    But Now after reading this post, I can easily handle these pages.

    Thanks for sharing such a helpful post with us. ๐Ÿ˜€

  2. Help Required !!

    i have upload two magento projects on same domain in folder httpdoc first project is running fine the second project i have made a beta folder in httpdoc and create here but i am facing 404 Error on home page images are displaying but other things are not working. Can any body tell me the solutions???

  3. By the way I forgot to tell you that they have changed the way “private sales” works ..now you do not need any physical directory.

  4. Thx for the hint! And I always assumed (well, at least hoped) that the cores of CE and EE were mostly identical. As this example shows, it’s probably for the better that they are not …

  5. The whole magento 1.9 is buggy .A clean install is not possible with this.I have faced many difficulties with this version.But at the last i make it working anyhow.
    I have also faced this problem when i am upgrading a website from magento CE to EE 1.9.

  6. Thanks for notice. We don’t think that there is any harm in pointing to something that will be helpful, but we understand that presenting block of code could be interpreted in different ways. Anyway, we updated the post a little and removed the larger code block and left only instructions.

    Enjoy coding! ๐Ÿ™‚

  7. Welcome to Magento Partners Club. The first rule of Magento Partners Club is: you do not talk about EE bugs. The second rule of Magento Partners Club is: you DO NOT talk about EE bugs! Wouldn’t post EE code either… I don’t think they’ll be happy with this.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.