Treat each hostname as its own configuration
The apex (example.com) and a subdomain (www.example.com) can have different DNS records and hosting associations. Adding one to a site does not guarantee that the other will resolve or present a valid certificate.
Check which record types your DNS provider supports at the apex and follow the hosting platform's instructions for each name. Do not copy a www target into the root record unless the provider specifically supports that arrangement.
Choose one canonical address
Select the address you want search engines and visitors to treat as primary, then configure a permanent redirect from the alternate hostname when your hosting setup supports it. Keep links and site metadata consistent with that choice.
Test both names over HTTPS, including redirects and common page paths. Confirm that each resolves to the intended site and that the certificate covers every hostname visitors may use.