https://www.foo.bar
is my main domain.
I want to redirect as well everything to bar.foo
.
It works fine with http
requests, but if I try https://bar.foo
, I get a certificate error and the redirect to https://www.foo.bar
does not occur.
The relevant part from config should be:
reqadd X-Forwarded-Proto:\ https
reqadd X-Forwarded-Port:\ 443
redirect prefix https://www.foo.bar code 301 if { hdr(host) -i foo.bar}
redirect prefix https://www.foo.bar code 301 if { hdr(host) -i www.bar.foo }
redirect prefix https://www.foo.bar code 301 if { hdr(host) -i bar.foo }
redirect scheme https if !{ ssl_fc }
Where is my mistake? Thanks in Advance.