This is usually a DNS configuration issue. Your root domain and www subdomain might not be pointing to the correct server.
Check your DNS records and make sure both versions are properly configured. Also, ensure that both versions are added to your hosting account and covered by your SSL certificate.
Once everything is working, you can set up a redirect so visitors always reach your preferred version.