Two ways to do it:
1) The symlink method. This works just fine.
2) The redirect method. I've become cantankerous and determined that
http://www.domain.com/ is redundant, so I've now standardized upon
http://domain.com/. This also means /var/www is much neater because there's not a lot of symlinks all around.
Anyway, here's the config I'm using for that:
Code:
$HTTP["host"] !~ "^(www\..*)$" {
## The document root of a virtual host isdocument-root =
## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root
simple-vhost.server-root = "/var/www"
simple-vhost.document-root = "/html/"
## the default host if no host is sent
simple-vhost.default-host = "default-fall-through.hoopycat.com"
}
# www.*
$HTTP["host"] =~ "^www\.(.*)" { url.redirect = ( "^/(.*)" => "http://%1/$1" ) }
Doing it the other way -- redirecting from
http://domain.com/ to
http://www.domain.com/ -- is left as an exercise for the reader.