404 Error on all pages in local site (MAMP)

404 Error on all pages in local site (MAMP)

August 22, 2026 · Illustrated author avatarBy Stefan Bogdanescu
404 Error on all pages in local site (MAMP)

Title: Resolving Magento 404 Errors on Local MAMP Installation

Introduction

Are you facing a frustrating issue where your Magento site displays a 404 error page for every single URL when migrated to a local MAMP environment? You’re not alone. This common problem can be resolved with the right troubleshooting approach.

Understanding the Issue

When migrating an online Magento store to a local development environment, it’s crucial that the base URLs and paths are set correctly for both secure and unsecure configurations in the core_config_data table of your MySQL database. Additionally, the .htaccess file plays a vital role in rewriting URLs and enabling SEO-friendly links.

Checking Core Configurations

Ensure you have updated the following values in the core_config_data table:

  • web/unsecure/base_url: Set this to http://localhost/your-magento-folder/
  • web/secure/base_url: Set this to https://localhost/your-magento-folder/

Make sure the paths are absolute and end with a trailing slash /.

Inspecting the .htaccess File

Magento relies heavily on Apache’s mod_rewrite module for URL rewriting. In your .htaccess file, ensure:

  1. The line RewriteEngine On is present and not commented out.
  2. The base URL in the RewriteBase directive matches your Magento folder path relative to the web root.

For example:

RewriteBase /your-magento-folder/

Verifying Mod Rewrite Configuration

In MAMP, open the Apache configuration file located at MAMP/conf/apache/httpd.conf. Ensure the following lines are uncommented and present:

LoadModule rewrite_module modules/mod_rewrite.so

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
</IfModule>

Troubleshooting Steps

  1. Check Rewrite Engine Status: In your browser’s developer tools, inspect the response headers to see if mod_rewrite is enabled.

  2. Validate Rewrite Rules: Comment out all lines in the .htaccess file except for RewriteEngine On, then test each uncommented line individually to identify problematic rules.

  3. Inspect Database Table

    • Check the core_url_rewrite table for valid rewrite entries.
    • Ensure there are no conflicting or duplicate entries.
    • Verify that the target_path and request_path fields match your local environment’s base URLs.
  4. Review File Permissions

    • The Magento root folder and its contents should have permissions set to 755.
    • The media, var, and pub folders should be set to 775.
    • Verify that the web server has write access to these folders for caching purposes.

Conclusion

Resolving Magento 404 errors on a local MAMP installation requires diligent attention to base URL configurations in the database and proper setup of the mod_rewrite engine. By following this guide and thoroughly inspecting your setup, you should be able to diagnose and fix the issue with confidence.

Remember, when dealing with Magento development, it’s crucial to maintain clean code practices and keep your local environment consistent with your production server configuration. If you’re looking for professional assistance or advanced solutions, consider reaching out to Laravel Company, a leading provider of Magento development services and e-commerce consulting.

Happy coding!

Database Extensions Configuration SEO

Our network