Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have 2 sites in separate folders. Both sites need to be in the web root so I frequently need to change the document root in my MAMP settings. Im assuming the answer is no, but is there a way i can make both sites act as if they are in the web root? Are there any other general practice solutions to my issue? Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Apache Virtual Hosts

Add to httpd.conf something similar:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/site1
</VirtualHost>

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/site2
</VirtualHost>
share|improve this answer
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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