I have 2 sites locally (in MAMP) both in their own folders. I need both sites to be in the web root which I can change in the MAMP settings each time Im working on a different site.

However now I need to be able to look at both sites 'head to head'. Is there any way (im thinking with the htacess file) to make both sites work at the same time?

  • Sorry a bit confused. Are you talking about being able to see two sites running on MAMP at the same time in two different tabs? http://localhost:8888/site1/ and http://localhost:8888/site2/
    – user12342
    Dec 27, 2012 at 19:55

1 Answer 1


a bit confused as to what exactly you are asking but i'll answer anyway. also, this question does not seem drupal specific.

yes... you can have both sites in the web root so to speak. however, vhosts will allow you to run both sites from any directory you want. take a look at the apache documentation on vhosts..

if you are doing your development local, you can adjust your hosts file to have sites dev1 and dev2 (for example) point back to your local development box (localhost).

as for removing the folder from the basepath, vhosts will handle this for you.

your vhost config might look lke this in httpd.conf

<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot /var/www/html/dev1
 ServerName dev1
 ErrorLog logs/dev1-error_log
 CustomLog logs/dev1-access_log common
<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot /var/www/html/dev2
 ServerName dev2
 ErrorLog logs/dev2-error_log
 CustomLog logs/dev2-access_log common

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.