Magento index page loads but 404 errors on all others

Magento index page loads but 404 errors on all others

August 14, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento index page loads but 404 errors on all others

Magento Index Page Loads but Encounters 404 Errors

The Problem: Magento Category Navigation Fails After Homepage

You’re not alone if you’ve experienced this frustrating issue when working with Magento. A fresh installation or migration often leads to successful loading of the homepage but a sea of 404 errors for categories and products. This is especially common in multiple store setups.

Understanding the Core Issue: URL Rewrite Management

At the heart of this problem lies an issue with Magento’s URL rewrite management system. The core_url_rewrite table contains entries that Magento uses to map your physical URLs (like /product/1234-red-shirt.html) to your logical product IDs. When Magento is moved or modified, these entries often become corrupted or incomplete.

Why Reindexing Fails

You mentioned reindexing the Catalog URL Rewrite, which is the standard method for fixing this issue. The reindex process should regenerate these entries based on your current catalog settings and products. However, if you’re seeing an error message like “Memory allocation limit… exceeded,” or a never-ending loop of “Indexing process unknown index type core_url_rewrite”, it suggests that the reindexing process itself has memory constraints or is encountering data integrity errors.

The Step-by-Step Solution

1. Clear Lock Files and Index Tables

First, delete all *.lock files from your Magento root directory (except .htaccess.lock). This will clear any outstanding indexing tasks. Then, you can manually delete the entries in the core_url_rewrite table by running:

TRUNCATE TABLE core_url_rewrite;

This deletes all URL rewrite records, allowing a fresh start.

2. Configure Base URLs

Navigate to your Magento admin panel and change the Base URL for Websites and Stores under System > Configuration. Ensure it matches your new domain exactly. For example:

http://newdomain.com

Remember that this setting is per store view.

3. Reindex with Cached Disabled

Now, try reindexing again. This time, you can increase the memory limit in php.ini or run PHP from the command line to bypass web server memory constraints. Also, ensure that Magento’s cache is disabled by setting:

<config>
    <global>
        <cache>
            <cache_enabled>0</cache_enabled>
        </cache>
   </global>
</config>

4. Refresh URLs and Regenerate Meta Tags

If the above steps don’t resolve your issue, you might need to refresh the URLs manually using a tool like Laravel Company’s Magento URL Rewrite Generator. This tool regenerates all necessary rewrite rules for your products and categories.

$generator = new \LaravelCompany\UrlRewriteGenerator($product);
$generator->generate();

Why Deleting Core Data Entries is Risky

While deleting the core_url_rewrite table might seem tempting, it’s important to note that this can break other parts of your Magento setup. For example, if you have custom URLs for CMS pages or third-party extensions like SEO tools, these entries will also be removed.

Conclusion: Patience and Cautious Rebuilding

This issue often requires a combination of manual intervention and careful reindexing. Be patient as the process can take time depending on your catalog size.

Remember that Magento’s URL management is complex and fragile. When migrating or updating your site, always backup your database first and be ready to revert if something goes wrong. If you find yourself stuck after following these steps, consider reaching out to a Magento professional for further assistance.

Catalog Indexing Database Configuration

Our network