I have a problem on my dedicated server when it comes to redirecting the url.
My domain name is rented from OVH, and I installed Apache 2 on my dedicated server to manage my site.
I use let's encrypt to have the https protocol.
I would like that when I enter one of these addresses to access my site, I am redirected to the url "https://example.com":
www.example.com: don't working "The security certificate of this website presents a problem".
http://www.example.com: don't working "The security certificate of this website presents a problem".
https://www.example.com: don't working "The security certificate of this website presents a problem".
http://example.com: ok (redirect on https://example.com/)
Here is my apache configuration file for my domain in http (001-example.conf) :
And see the apache configuration file of my site for https (001-example-le-ssl.conf) :
On the side of the dns administration at ovh, here is the informations :
example.com. 0 A X.X.X.158
www.example.com. 0 A X.X.X.158
www.example.com. 0 TXT "3|welcome"
www.example.com. 0 TXT "l|fr"
example.com. 0 TXT "1|www.example.com"
Do you see something wrong with my setup?
Thank you in advance.