I have a question regarding redirecting https requests.
Background
The situation
I have a user with two domains pointing to the same site: foo.com and bar.com. Through Aegir, I am forwarding foo.com to bar.com. Requests for http://foo.com redirect to http://bar.com with no problem. The user also has a SSL that only covers bar.com, but not foo.com.
The question
On Apache (or, through Aegir) is it possible to forward https://foo.com requests to https://bar.com without throwing a certificate warning? Currently, anyone who makes a request to https://foo.com receives a certificate warning.
Many thanks for any expertise you can share!
No it's not possible.
When a browser requests a https site, the browser does the SSL negotiating first, and then handles the request (in this case returning the redirect).
So you need to have a valid cert for foo.com to pass that first stage.
Yes it is possible. There is the self-sufficient way and the easy way. :)
Set up Let's Encrypt to automatically get an SSL certificate for foo.com on the machine that is running appache. You can now enable HTTPS for foo.com and have it forward both HTTP and HTTPS requests to bar.com
Use the free forwarding service https://redirect.pizza. They basically do the above for you. You tell them where to forward foo.com and then point foo.com DNS to them.
DISCLAIMER: I have nothing to do with redirect.pizza, I just really like their service. I was going to build the exact same service when I got frustrated that godaddy.com does not offer something like this, but then (luckily) found them and they did it perfectly to saved me the effort.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With