Why am I getting a 'not found' error for a subdirectory store in Magento?

Why am I getting a 'not found' error for a subdirectory store in Magento?

October 17, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Why am I getting a 'not found' error for a subdirectory store in Magento?

Resolving ‘Not Found’ Errors for Magento Subdirectory Stores

If you’re receiving a ‘not found’ error when trying to access your second storefront set up using the subdirectory method in Magento CE 1.7.0.2, you’ve likely encountered an issue with the Mage.php file path. Let’s troubleshoot this problem step-by-step.

Understanding the Mage.php File Path Issue

When configuring a subdirectory store, Magento expects to find the Mage.php file directly at the root level of your project. However, since the file is actually located in the ‘app’ folder, Magento struggles to locate it when you navigate to a subdirectory URL.

For example, if your second store uses ‘/store2’ as its subdirectory and you navigate to ‘http://your-domain.com/store2,’ Magento will look for ‘Mage.php’ at the root level of ‘/store2/.’ This is why you’re seeing the “[my root directory]/[my new store’s subdirectory]/app/Mage.php was not found” error message.

Resolving the Mage.php File Path Issue

To resolve this, we need to tell Magento where to look for the Mage.php file. We can do this by modifying the /index.php file in each of your subdirectories.

  1. Locate the ‘/index.php’ file for your second store (e.g., ‘http://your-domain.com/store2/index.php’).

  2. Open this file using a text editor or an FTP client.

  3. Find the following line:

require_once('app/Mage.php');
  1. Replace it with the corrected path:
require_once('../app/Mage.php');

Note: The ’../’ ensures that Magento looks one level up in the directory hierarchy to find the ‘app’ folder and the Mage.php file.

  1. Save the changes and close the file.

  2. Repeat steps 1-5 for any additional subdirectory stores you have set up.

Verifying Your Changes

After updating the /index.php files, navigate back to your second store’s URL (e.g., ‘http://your-domain.com/store2’). You should now be able to access it without seeing the ‘not found’ error message.

Remember, this fix is specific to subdirectory stores and won’t affect your main Magento installation or other types of multistore setups. It’s a critical step when using the subdirectory method described by many tutorials, including those on Laravel Company’s own blog.

Conclusion

The ‘not found’ error for Magento subdirectory stores is a common issue that arises due to incorrect file path configuration. By updating the index.php files in your subdirectories, you can easily resolve this problem and ensure smooth navigation between your multiple storefronts.

Always remember to verify your changes in each subdirectory store setup to maintain the integrity of your Magento installation. If you encounter further issues or need additional guidance on multistore configurations, don’t hesitate to explore our in-depth tutorials and best practices on Magento development.

Magento 1 Configuration Errors CLI

Our network