Published: January 14, 2019
Last updated:

Magento’s “404 error: Page not found” in default design after SUPEE-10415

Magento throws 404 error: Page not found. in default design for any request after SUPEE-10415 patch installation or after upgrade to Magento 1.9.3.7 version and newer: magento-404-error-page-not-found-default-design

It shows 404 error for all pages: Magento backend, Home page, product pages, category pages etc.

Cause

The following code was added in SUPEE-10415/Magento 1.9.3.7 to log function of app/Mage.php file to validate log file extensions:
        // Validate file extension before save. Allowed file extensions: log, txt, html, csv
        if (!self::helper('log')->isLogFileExtensionValid($file)) {
            return;
        }
With that code, Magento is not properly logging PHP warnings that occur early during page initialization. Instead, of logging the error and continuing operation, Magento generates a 404 page. (Previously, Magento logged these warnings in the system.log file, and execution would continue as usual.)

Solution

To solve the error it is required to solve all issues that causing PHP errors, warnings or notices printed in PHP error log. You can ask your hosting support to provide you PHP error output if you are unsure about exact location of your PHP error log.

In the meantime, to bring Magento back to function you can apply one of the following workarounds:
  • Disable logging via direct SQL update:
    mysql> update core_config_data set value=0 where path='dev/log/active';
    Query OK, 1 row affected (0.01 sec)
    Rows matched: 1  Changed: 1  Warnings: 0
    
    You may need to Flush Magento cache to apply changes
  • Disable call to isLogFileExtensionValid() function in app/Mage.php by commenting out newly added lines:
    --- app/Mage.php
    +++ app/Mage.php
             $level  = is_null($level) ? Zend_Log::DEBUG : $level;
             $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)) {
    -            return;
    -        }
     
             try {
                 if (!isset($loggers[$file])) {
    


If you have any difficulties with solving this problem or got a similar one, please let us know in comments below, so we can find the solution together.

Posted in: Troubleshooting

39 votes, 4.84 avg. rating (96% score)