Forum

Generic Vhost by third level domain

Gianpaolo
6 May 2016, 17:12
Hello Hugo, a little question: is it possible to config a vhost (working with all your domains) keeping only the third level domain?
Example: i would like to create a vhost config for m.example.com, e.example.net, m.doobiebrothers.org ecc...
My intention is to have a general rule working on "m" third level, because to not rewrite it on every new domain.
Thank you very much for your answer and for your wonderful web server!!!
Ciao
Gianpaolo
Gianpaolo
9 May 2016, 15:46
Sorry, this is the correct example:
i would like to create a vhost config for m.example.com, m.example.net, m.doobiebrothers.org ecc...
Thanks
Hugo Leisink
10 May 2016, 08:57
I don't understand what you mean with 'keeping only the third level domain'.
Gianpaolo
10 May 2016, 21:34
I've different domains and I would like to create a vhost config for all domain called for mobile configuration.
In default way domain1.com,www.domain1.com, domain2.net,www.domain2.net goes to the specified vhost config, but I would like unique vhost config for m.domain1.com and m.domain2.net
The problem is about the number of domains, because at the moment I've to create a vhost group for 20/30 domains
I don't know if it's possible to create a vhost like m.* (m.domain1.com, m.domain2.net, ecc.)
Hugo Leisink
10 May 2016, 21:47
If I understand you correctly, you want a configuration like this:
VirtualHost {
Hostname = m.*
...
}

Which should match all hostnames starting with 'm.' Correct? If so, than I have to disappoint you. That's not possible in Hiawatha. A wildcard is only possible at the start of a hostname, like *.example.com.
Gianpaolo
14 May 2016, 15:52
Yes, you understood very well and I have no disappoint about this problem, your server still great!
I will resolve by code.
Thank you very much!
Bye
This topic has been closed.