lets encrypt ssl is working in mydomain.com but not working in www.mydomain.com

June 17, 2019 245 views
Let's Encrypt Ubuntu

Hello everyone!
I have a domain that I could manage to run it as https://mydomain.com; however when I run my domain as www.mydomain.com or http://mydomain.com, the page redirected to https://www.mydomain.com and shows Your connection is not private. I had seen someone had the same question here but the answers are deleted and as the result I am asking it again. Please consider simple way of configuration as I am almost new in ssl. Thanks for the help guys! :)

3 Answers

When you installed the certificate, did you add both mydomain.com AND www.mydomain.com?
Try reinstalling your certificates with -d domain.com -d www.domain.com
Replacing domain with your actual domain...

  • How should I uninstall the current one in order to redo the whole procedure by considering your hint?

No I think I just used -d mydomain.com
There is not any shortcut to not re-install it again? Actually I used the tutorials from Example link

Which http server are you using: apache or nginx?

  • nginx. I do not have dare to do mistakes again so please provide me the simplest straightforward help to reduce redundancy to fix this issue! thanks!

    • Make a backup/snapshot then cd into your certbot installation directory then run sudo certbot --nginx -d example.com -d www.example.com ensuring that both domains are on it this time.

    • Even if it is possible I do not change any thing and I just somehow route www.mydomain.com to mydomian.com that use https will be the best.

Have another answer? Share your knowledge.