Set up virtual domains for MAMP with this great hack from springworks. Be sure to quit MAMP first.From the tip on the Joynet board:
- With a text editor that can open hidden files (eg TextWrangler (free) or TextMate), open /private/etc/hosts
- Find the line which reads
127.0.0.1 localhost3. add the name of your chosen virtualhosts at the end of this line, separating each of them with a space, like this:
127.0.0.1 localhost mytestdomain1.dev mytestdomain2.dev
4. Save the file. You will need to provide an Administrator password to do this.
5. Create a folder for each of your test domains in the Sites folder in your home folder, eg: /Users/myusername/Sites/mytestdomain1.dev /Users/myusername/Sites/mytestdomain2.dev
6. Now open the MAMP httpd.conf, which you can find in /Applications/MAMP/conf/apache/httpd.conf
7. At the end of this file, insert the following:
NameVirtualHost *:80 <VirtualHost *:80> ServerName localhost DocumentRoot "/Users/myusername/Sites" </VirtualHost> <VirtualHost *:80>ServerName mytestdomain1.dev DocumentRoot "/Users/myusername/Sites/mytestdomain1.dev" </VirtualHost> <VirtualHost *:80> ServerName mytestdomain2.dev DocumentRoot "/Users/myusername/Sites/mytestdomain2.dev" </VirtualHost>
8. In the MAMP preferences, choose the Ports section and click on the "Use default Apache and MySQL ports". Now stop the MAMP servers and restart them again.
You should now be able to reach all of your test domains at the same time, using just the domain name as the address, none of this "localhost:8888/mytestdomain1/" stuff.