1
votes

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":

Here is my apache configuration file for my domain in http (001-example.conf) :

enter image description here

And see the apache configuration file of my site for https (001-example-le-ssl.conf) :

enter image description here

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.

1

1 Answers

0
votes

The certificate has to match the Fully Qualified Domain Name (FQDN) that the user is accessing, so if your certificate is only for example.com, then it will not cover www.example.com, the solution would be to remake the certificate and make the common name example.com, and add a Subject Alternative Name (SAN) to the certificate that is www.example.com, that way it will cover both FQDNs