I have a question of best practice with ssl configuration. Here is my case.
Let's say we have two domains house.com and little_house.com
The little_house.com will not have any web content, it exists just to get traffic for house.com, so I would like to redirect all traffic from little_house.com to the main domain house.com
Domain house.com should be available in http and https version.
For this scenario please tell me what is the best practice and if it makes sense what I did:
Create Virtual Host house.com.conf for domain house.com that will rewrite domain to ssl version as follows:
Create Virtual Host little_house.com.conf for domain little_house.com without any cert ssl. Just pure rewrite to ssl version of house.com. I mean https://house.com as follows:
The three parts are good [so far].
But you are missing the fourth part: Handling https://little_house.com/
Handle all possible cases with the least amount of client inconvenience:
[usually something like]
http://example.com/ > redirect to https
https://example.com/ serve the site/content here
http://another.example.com/ > redirect to https
https://another.example.com/ > redirect to https://example.com/
Which means you will need to get a cert [or certs] to cover both names.
If the names are pointing to the same IP, you could combine them easily onto one cert.
What will happen if I will keep "combined" cert, and for one domain from the "combined bucket" will change DNS IP and try to generate a brand new cert? Can it be done like that? Will the combined domain with combined cert still work? Just wondering.
I apologies if something my questions are weird, but I am completely new in topic of ssl certifications.
The certificate itself is valid on any server where it's installed with the matching private key, regardless of whether that's the same or different server where the certificate was obtained, and regardless of whether the certificate is used on one or more servers at the same time.
However, it could be difficult to get Let's Encrypt to issue a renewal certificate to replace the combined certificate in the future, if the domains are no longer pointing to the same server, since whatever server tried to make the request might not be able to satisfy the certificate authority's proof-of-control challenges anymore.
Since Certbot and other Let's Encrypt client applications normally request a certificate with the same domain name coverage as the old certificate had, the renewal attempts would fail if one or more of the covered domains can't be included in the new certificate.
You mentioned the least amount of client inconvenience (redirects/clicks). What about the configuration as below with one cert for example.com and another.example.com ?
http://example.com/ > redirect to https://example.com/
https://example.com/ serve the site/content here
http://another.example.com/ > redirect to https://example.com/
https://another.example.com/ > redirect to https://example.com/
That one saved redirection [which are automatic in all browsers] not one additional click saved.
And it is actually preferred NOT to switch from HTTP to HTTPS while also switching from domain1 to domain2.
[but that should be possible]
The difference is that the client does nothing.
The browser makes a request the web servers reply says "that's not here, look elsewhere" and the browser automatically goes and looks "elsewhere" for it.
I think I do not have more questions. Seems to be more clear now for me.
Thank you so much for sharing the knowledge.
I have a few questions of Internationalised Domain Names (IDNs) and its ssl configuration, but it it out of this topic. I will describe what is my concern and open another one.
Thank you so much for your help and time. I appreciate it.