Hrm, are you saying you want a wildcard subdomain, so that *.domain.com all displays the same content?
You can do that by going into Server Configuration -> Website Options, and set “Website matches all sub-domains” to “Yes”.
Also, there’s the concept of a “default domain”. The first VirtualHost configuration Apache runs into in it’s config file is the default domain for that particular IP address.
If you wish to change what domain shows up by default, you can set that in the Website Options screen if you’re using Virtualmin Pro… or just manually move the VirtualHost configuration in the Apache config file if you’re using Virtualmin GPL.
You can do that by going into Server Configuration → Website Options, and set “Website matches all sub-domains” to “Yes”.
Is that option in Virtualmin Professional only? I don’t see it in this GPL version:
Webmin version 1.520 Virtualmin version 3.73.gpl GPL
I edited line 97 in virtual-server/domainname-lib.pl to accept something starting with *. as a
valid alias. This isn’t that uncommon - ears ago many hosts did it by default because you want
typos like wwww.site.com and ww.site.com and such to come to you, not be lost traffic.
sorry to dredge up such an old post, but is there an option to enable the “Website matches all sub-domains?” option to on as default. I figured this would be in server templates but did not see it.
You’re right, I don’t think such an option exists. It might be a good idea to add it indeed.
Until then, it could help to manually add the required Apache and BIND directives in the template. For Apache, adding the line ServerAlias *.${DOM} should help, and for BIND, you’ll want to put *.${DOM}. IN A {IP} and set the radio button to “Add above to automatically generated records”.
The option “Website matches all Subdomains” will get user1.example.com to www.example.com, as with all other subdomains, so no avail.
The option to set the standard website does not help either, because there are other domains like www.atest.com, which will be in fact the first one in the directory, which will be chosen as default domain. Can’t i have a default domain per domain? so to say, whateveritypehere.example.com will be routed to www.example.com and also whateveritypehere.atest.com will be routed to www.atest.com? This is confusing the visitors. If i have two different own projects, one for IT the other one for Audio/Video, and the audio video guys have a typo in the according subdomain and they end up in the IT part.
Any chance to achieve this, and how? I heared, that others should have it, but i am not sure, whether this is correct…