How to fix 404 error after upgrading Magento (or installed security patches)

404 error page not fould in magento
Last updated on

I will tell you 4 solutions to fix the 404 error after upgrading Magento version or cause by installing security patches, maybe its problem with new server migration.

If you have just upgraded your Magento store to new versions or installing security patches, even when you migrate/move your store to another server then your store was going down with 404 error – page not found on the frontend (maybe the same error is displayed in admin panel page also). This problem often cause by Magento cache is crashed/corrupted or something is conflicting when implement security patches (new code is applied). Or there was some incorrect entries, tables in database is missing when upgrading/moving your store.

For identifying exactly what’s the problem you can log in to FTP Client program (eg: Filezilla…) or server with File Manager and go to location /var/report and /var/log of Magento store files where its located (root directory) then checking error logs files (this may help resolve your problem also).

Anyway, you can try the following solutions below to fixing it (step by step and stop when its fixed):

Solution 1 (clear cache/cookies):

Log in to FTP Client or File Manager on server and navigate to folder location: /var/cache then delete this folder for clearing cache or clear cookies also if needed (if you can log in to admin panel so you can disable all cache or fflush magento cache there). For more details please read this article.

Solution 2 (reset data of some tables, comparing them with original DB):

Log in to the Phpmyadmin what database is associated with your store and run the following SQL commands below (you can back up database if you’re carefully, i recommend this 🙂) :

UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';

Solution 3 (default store isnt active) :

If you tried with solution 2 and it didn’t work, please log in to the Phpmyadmin what database is associated with your store again and find the core_store table then edit row with column code =”default by change the value from 0 to 1 for column is_active

is_active in core_store table db magento

Solution 4 (Mage::log() problem):

Log in to FTP Client and navigate to folder location: /app then open file Mage.php find following code below (around lines: 808-813):

$file = empty($file) ? 'system.log' : basename($file);

// Validate file extension before save. Allowed file extensions: log, txt, html, csv
 if (!self::helper('log')->isLogFileExtensionValid($file)) {

and replace them with (you can comment out them for backup):

$file = empty($file) ? 'system.log' : $file;

Note: this solution for Magento version 1.9.3+


This error may happens when mod_rewrite is not enabled (you didn’t use index.php in your url ),  also .htaccess file is missing or but that is another 404 error type.


Clear/remove cache and cookie when making changes and checking files permission also (it will be better if reset them)

I hope this will help. Leave your comment if its useful for your problem.


Post a Comment

Please keep in mind that all comments are read and moderation.
Your email address WILL NOT be published. Please DO NOT use keywords in the Real Name field. Thank you !


  1. I try to “UPDATE core_website SET website_id = 0 WHERE code=’admin’;” after that, I can access sub page but front page and backend can’t access. I don’t know why. Anyone know how to fix it?


  2. Hi, steps 1, 2 and 3 did nothing for me, but 4 seemed to work at first, but after a refresh, I am now stuck in the too many redirects loop 🙁


    • Kristof,
      We’re happy when #4 worked for you. If you couldn’t fix it completely then contact us by using contact page. We’re glad to help you!


  3. After 4 and a half hours of troubleshooting URL rewrites, settings and being just about ready to crash my car into a tree on my way home, step 4 finally fixed my issue.

    Thank you!


Get $100 Free from Vultr to accelerate your website and application Register a Domain Name on Namesilo