Reputation: 891
I'm trying to setup a server with two VirtualHost
records like so:
<VirtualHost *:80>
ServerName sub.domain.com
DocumentRoot /path/to/dir/
SetEnv FLAG false
</VirtualHost>
<VirtualHost *:80>
ServerName sub.*.domain.com
DocumentRoot /path/to/dir/
SetEnv FLAG true
</VirtualHost>
I'd like the domain sub.domain.com
to go through the first VirtualHost
and a domain such as sub.test.domain.com
to go through the second.
At the moment, the FLAG environment variable is always set to false, suggesting that sub.test.domain.com
doesn't match the second one and so reverts to the first.
The only thing I can see being a problem is that the wildcard in the second ServerName
directive is in the middle of the domain. Is this allowed or is something else the problem?
Upvotes: 1
Views: 280
Reputation: 4140
You don't seem to be able to use wildcards in ServerName
, use ServerAlias
instead.
Upvotes: 1