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

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
Hi there,
It do not work for me. Google Webmaster still notice many 404 pages on my site. Thanks
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. 😀
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???
Thanks for hepl
@dotroy
Awsome
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.
It is fixed in EE 1.9.1.1
Professional 1.9 – same problem, same fix. Thanks!
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 …
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.
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! 🙂
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.
Yeah we saw this and Magento just sent us the patch doing the same thing