Whttpd & /etc/hosts
Can we configure such that calls resolve to Whttpd when domain as specified in local hosts file is edited like:
127.0.0.1 localhost 127.0.0.1 mydomain.lcl 127.0.0.1 www.mydomain.lcl
I tried it without success.
Updated by Bud T almost 9 years ago
Wim Dumon wrote:
wthttpd does not support virtual hosts as configuration, so this should simply work without configuration.
This is what I have in my hosts file on Windows 7:
127.0.0.1:8080 localhost 127.0.0.1:8080 domain.lcl 127.0.0.1:8080 www.domain.lcl
These don't resolve to the Wt app which otherwise display fine when calling http://127.0.0.1:8080
Updated by Wim Dumon almost 9 years ago
Your browser is always going to send a request to port 80 of your computer unless you put :portnumber in the url. The hosts file cannot change that. Support for aliases in Wt cannot change that (note in Wt you can look at the Host http header to decide what WApplication you instantiate, which mimics support for virtualhosts). To do what you want, you will have to modify your Apache configuration since only one application can listen at port 80.