« Back to blog

Configure Apache for mod rewrite on Mac

To configure Apache's mod rewrite on your Mac, you need to change a few default settings.

1. Edit /etc/apache2/httpd.conf

In the default section (starts line 177):

Change AllowOverride from None to All. It should look something like this:

<Directory />
    Options FollowSymLinks
    AllowOverride All

Do the same for any other directory sections you have specifically listed (the only other default is <Directory "/Library/WebServer/Documents"> )

2. Edit /etc/apache2/users/yourname.conf

Add FollowSymLinks to the Options line and change AllowOverride to All. It should look something like this:

<Directory "/Users/tee/Sites/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All

3. Restart Apache:

sudo apachectl graceful

4. Now you can put .htaccess files in whatever sites you're running under /Users/yourname/Sites and go bananas with the rewrites.

Yes I'm still running Leopard. I'm not sure if this applies exactly to Snow Leopard, but likely it does.