Results 1 to 2 of 2
Thread: Apache VirtualHost Help
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Nov 2009
Apache VirtualHost Help
my httpd.conf is as follows (changed the domain and user names for security)
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /home/user1/domain1.com/public_html ServerName domain1.com <Directory /> AllowOverride All </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot /home/user2/domain2.com/public_html ServerName domain2.com <Directory /> AllowOverride All </Directory> </VirtualHost>
i tried in a different browser incase it was showing a cached page from a previous viewing but its not.
Any suggestions ?
the config looks ok.
What comes to mind:
Any servername, that is not explicitly written in the config will default to the first server.
In your example:
domain2.com should return domain2. But www.domain2.com will return domain1.
you can use ServerAlias, together with wildcards.
ServerName www.domain2.com ServerAlias domain2.com ServerAlias *.domain2.com