getting mod_rewrite to work on Mac OS X
You should set up Virtual Hosts.

In /etc/apache2/httpd.conf uncomment the line:

#Include /private/etc/apache2/extra/httpd-vhosts.conf


Now edit /etc/apache2/extra/httpd-vhosts.conf. Remove the example vhosts, but do specify a default vhost as the first one. Here's an example config.

NameVirtualHost *:80

&lt;VirtualHost *:80&gt;
        DocumentRoot /Library/WebServer/Documents
&lt;/VirtualHost&gt;

&lt;VirtualHost *:80&gt;
        ServerName myproject
        DocumentRoot /Users/username/Sites/myproject
        &lt;Directory /Users/username/Sites/myproject&gt;
                Order Allow,Deny
                Allow from all
        &lt;/Directory&gt;
&lt;/VirtualHost&gt;


Restart apache by running apache2ctl restart.

You should add an entry to your /etc/hosts file so that your servername resolves:

127.0.0.1  myproject


Now, when accessing the http://myproject, your rewrite rules will be relative to the right document root.