What is the best or proper way to specify two http hosts with the same document root on Lighttpd? For example, to serve a domain at example.org and www.example.org.
Given the following in the lighttpd.conf
for one host:
$HTTP["host"] == "www.example.org" {
server.document-root = "/path/to/root/example"
}
Is this a valid configuration for two hosts?
$HTTP["host"] == ( "example2.org", "www.example2.org" ) {
server.document-root = "/path/to/root/example2"
}
Or do you have have to duplicate/repeat the $HTTP["host"]
field for each?
No, this does not appear to work when testing the configuration file with:
I guess each
$HTTP["host"]
field has to be separate, with theserver.document-root
repeated if you want different sub-domains to serve the same site data.