Fix "Not Found: The Requested URL Was Not Found on This Server" Error in...

Steps to Enable mod_rewrite in MAMP

1. Locate the Apache Configuration File

  • Open the Apache configuration file used by MAMP:

    /Applications/MAMP/conf/apache/httpd.conf
  • You can open it in a text editor:

    sudo nano /Applications/MAMP/conf/apache/httpd.conf

2. Enable mod_rewrite

  • Search for the line that includes mod_rewrite:
    #LoadModule rewrite_module modules/mod_rewrite.so
  • Uncomment it by removing the #:
    LoadModule rewrite_module modules/mod_rewrite.so

3. Allow Overrides for .htaccess

  • Look for the <Directory> directive for your document root. It should look something like this:
    <Directory "/Applications/MAMP/htdocs"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
  • Change AllowOverride None to AllowOverride All to allow .htaccess files to work:
    <Directory "/Applications/MAMP/htdocs"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

4. Restart Apache

  • Restart MAMP to apply the changes:
    1. Open the MAMP application.
    2. Stop the servers using the "Stop Servers" button.
    3. Start the servers again using the "Start Servers" button.



Post a Comment

Previous Post Next Post