I have been getting lost amidst forum posts on this issue.
1) I have MAMP (not Pro) Installed
2) My Apache port is set to 8888
3) My Document Root in preferences is set-up to /Users/usr/Sites
I want to set-up multiple local subdomains i.e.
private/etc/hosts
127.0.0.1 local1.sitename.com
127.0.0.1 local2.sitename.com
127.0.0.1 local3.sitename.com
No that is where the problem arises. In the httpd-vhosts.conf I tried to set up the following:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Users/usr/Sites/Site1Name“
ServerName local1.sitename.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Users/usr/Sites/Site2Name“
ServerName local2.sitename.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Users/usr/Sites/Site3Name“
ServerName local3.sitename.com
</VirtualHost>
etc.
For some reason all of these subdomains point to the same localhost:8888 document root directory. What am I doing wrong?
Thanks
I fixed this issue somehow by simply typing the directive for my virtual hosts as follows"
<VirtualHost *:80>
DocumentRoot /Users/usr/Sites/Site2Name/
ServerName local.Site2Name
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /Users/usr/Sites/Site3Name/
ServerName local.Site3Name
</VirtualHost>
Don't ask me to explain why did this fix the problem though. If anyone knows the answer, let me know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With