Don P
Don P

Reputation: 63718

vhosts only shows one root for all domains

I am using MAMP. I want separate domains to use different roots on my local computer.

Here is my httpd-vhosts.conf file:

NameVirtualHost *:80

<VirtualHost *>
  DocumentRoot "/Users/donald/Projects/wowzers"
  ServerName wowzers.loc
</VirtualHost>

<VirtualHost *>
  DocumentRoot "/Users/donald/Projects/secondsite"
  ServerName secondsite.loc
</VirtualHost>

Right now, typing "localhost", "wowzers.loc", or "secondsite.loc" will all navigate to the first entry in my vhosts file. In this example, everything navigates to "wowzers.loc".

Why do all my servernames point to the top entry?

Upvotes: 0

Views: 145

Answers (1)

FaCE
FaCE

Reputation: 188

You should try it without the quotes around DocumentRoot and also pass the same argument from NameVirtualHost to VirtualHost i.e.: <VirtualHost *:80>

Apache documentation

Upvotes: 1

Related Questions