1. Enable .htaccess overrides in the entire server
  2. Enable mod_rewrite log for debugging

Here is how to enable htaccess overrides in a MAMP server for local development. This is useful to test PHP configurations where you want to use a .htaccess file to redirect all requests to a specific file, say, an index.php that acts as a router, enabling you to use pretty URIs such as /users, /users/new, etc. for your PHP application.

Enable .htaccess overrides in the entire server

Before:

1
2
3
4
<Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory>

After:

1
2
3
4
<Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
</Directory>

Enable mod_rewrite log for debugging

1
2
3
4
5
# Mod rewrite configs

RewriteEngine On
RewriteLog "/Applications/MAMP/logs/rewrite.log"
RewriteLogLevel 5

Then you can tail -f /Applications/MAMP/logs/rewrite.log to debug your rewrites.