Forum

virtual host

newbie
6 April 2010, 11:28
Hiawatha version: 7.1
Operating System: Ubuntu

Dear sir,
I want to see the same web page from typing "www.abc123.com" or "abc123.com" in browser. How could I do the settings with virtualhost?
Martin
8 April 2010, 23:28
There was some dicussion on that here:
http://www.hiawatha-webserver.org/forum/topic/394

Here is a real-life example from my hiawatha configuration:

UrlToolkit {
ToolkitID = addwww
Match ^/(.*) Redirect http://www.daemonforums.org/$1
}

[...snip...]

VirtualHost {
Hostname = daemonforums.org
WebsiteRoot = /home/www/daemonforums.org
UseToolkit = addwww
}
VirtualHost {
Hostname = *.daemonforums.org, daemonforums.net, *.daemonforums.net, daemonforums.com, *.daemonforums.com
WebsiteRoot = /home/www/daemonforums.org
AccessLogfile = /var/log/hiawatha/daemonforums.org/access.log
ErrorLogfile = /var/log/hiawatha/daemonforums.org/error.log
StartFile = index.php
ExecuteCGI = yes
UseFastCGI = php
}
Hugo Leisink
9 April 2010, 01:30
You should not use a hostname with a wildcard (*) as the first hostname in the list. This can cause problems with 301 errors.
Martin
9 April 2010, 01:55
Does it matter in this example since daemonforums.org (w/o *) is caught by the first vhost?
Hugo Leisink
9 April 2010, 17:28
No, because when daemonforums.net or .com is requested and a 301 return code is send, the *.daemonforums.org is used. I've changed this behaviour in 7.2, so it won't be a problem anymore then.
This topic has been closed.