Hi,
The incoming Hiawatha server has a reverse proxy configuration like:
VirtualHost {
Hostname = website2.eu, www.website2.eu
ReverseProxy .* http://192.168.0.6:80/
WebsiteRoot = /usr/local/www/dummy/index.html
}
The receiving Hiawatha server that should handle requests to
website2.eu has the following configuration:
Binding {
Port = 80
Interface = 192.168.0.6
BindingId = wp
}
Binding {
Port = 443
Interface = 192.168.0.6
BindingId = wpssl
TLScertFile = /usr/local/etc/ssl/website2_wosign.pem
}
VirtualHost {
Hostname = www.website2.eu, website2.eu
EnforceFirstHostname = yes
RequiredBinding = wp
WebsiteRoot = /usr/local/www/wordpress
}
VirtualHost {
Hostname = www.website2.eu, website2.eu
EnforceFirstHostname = yes
RequiredBinding = wpssl
TLScertFile = /usr/local/etc/ssl/website2_wosign.pem
UseToolkit = denied
}
This site (wordpress) is using php-fpm, not shown.
The behavior I want is that when a user tries to access the site via
http://website2.eu
it should be redirected to its
www. counterpart.
And when using https, the same thing, from
https://website2.eu
to
https://www.website2.eu
.
The present configuration causes a
This webpage has a redirect loop or similar message both in Firefox and Chromium.
Note: in my last attempt, I changed a:
UrlToolkit {
ToolkitID = redirect
Match ^/(.*) Redirect http://www.website2.eu/$1
}
and, instead, placed the
EnforceFirstHostname = yes to try to avoid those redirects, but to no success. Maybe this directive doesn't mean what I thing it does.
So, what is wrong with my config? In the firsts Hiawatha server configuration? in the receiving website2 configuration? How to do it?