Ok - Here's the scenario...
I have a domain It's documentroot is /var/
I want to have test1.example1.com as a server alias BUT I want it's document root to be /var/And I want to have test2.example1.com as a server alias but I want it's document root to be /var/
Note they are the same domain, just different aliases.
Now setting up a ServerAlias is easy enough (ServerAlais test1.example1.com test2.example1.com)
But getting their documentroot values to change isn't...
Can I set up each one of those aliases as it's own virtual host?
example...
Code:
Listen 0.0.0.0:80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName DocumentRoot "/var/</VirtualHost>
<VirtualHost *:80>
ServerName test1.example1.com
DocumentRoot "/var/</VirtualHost>
<VirtualHost *:80>
ServerName test2.example1.com
DocumentRoot "/var/</VirtualHost *:80>
So far this configuration is not working for me as all of the requests are just going to the first default setup. Is there something I am missing - something in the rest of my httpd.conf I should be looking for? Is doing this with the same domain but different aliases even possible?
I have a domain It's documentroot is /var/
I want to have test1.example1.com as a server alias BUT I want it's document root to be /var/And I want to have test2.example1.com as a server alias but I want it's document root to be /var/
Note they are the same domain, just different aliases.
Now setting up a ServerAlias is easy enough (ServerAlais test1.example1.com test2.example1.com)
But getting their documentroot values to change isn't...
Can I set up each one of those aliases as it's own virtual host?
example...
Code:
Listen 0.0.0.0:80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName DocumentRoot "/var/</VirtualHost>
<VirtualHost *:80>
ServerName test1.example1.com
DocumentRoot "/var/</VirtualHost>
<VirtualHost *:80>
ServerName test2.example1.com
DocumentRoot "/var/</VirtualHost *:80>
So far this configuration is not working for me as all of the requests are just going to the first default setup. Is there something I am missing - something in the rest of my httpd.conf I should be looking for? Is doing this with the same domain but different aliases even possible?