When I start work on a new web project I usually create a new virtualhost on my development machine so that I can access a local version of the site at something like http://myproj/ instead of http://localhost/~myusername/myproj. I use a nice little shell script written by Patrick Gibson called virtualhost.sh that handles this task on OS X. One little snafu I run into depending on my ISP is that their DNS servers will sometimes capture my local request to the domain name and try to redirect before my request even hits my local server. To fix this, you have to edit your local hosts database. Open up /private/etc/hosts and add a line like:
127.0.0.1 myproject
Now, any requests to http://myproject/ should be recognized as a local host and your DNS servers will no longer redirect you.




