: Multiple VirtualHosts with wildcards I have a three VirtualHosts. The second two utilize wildcards. www.example.com *.sites.example.com (i.e. foo.sites.example.com) *.*.sites.example.com (i.e. foo.bar.sites.example.com)
I have a three VirtualHosts. The second two utilize wildcards.
example.com *.sites.example.com (i.e. foo.sites.example.com)
*.*.sites.example.com (i.e. foo.bar.sites.example.com)
For the second two, I tried:
ServerName example.com
ServerAlias *.example.com
and
ServerName example.com
ServerAlias *.*.example.com
Problem is *.example.com gobbles up *.*.example.com. As maybe a hack, I put *.*.example.com before *.example.com in my httpd.conf file.
Is what I did the proper way to do this, or is there a more official way?
More posts by @RJPawlick198
1 Comments
Sorted by latest first Latest Oldest Best
You did it the right way.
Apache always takes the first VirtualHost if multiple entries match.
For more information about Virtual Host Matching look at the official documentation: httpd.apache.org/docs/2.4/vhosts/details.html
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.