If you're using Amazon Lightsail to host your website, you may have noticed that you can't create a non-www A record in the DNS management console. This is because Amazon Lightsail requires that you use a CNAME record for your root domain name (i.e. yourdomain.com).
If you want to use a non-www address for your website (i.e. http://example.com), you'll need to set up a redirect from your www address to your non-www address. You can do this using the Lightsail console, or you can set up a redirect using your web server software.
To set up a redirect using the Lightsail console, follow these steps:
Log in to the Lightsail console.
Click on the DNS zone for your domain.
Click on the Edit button next to the CNAME record for your www address.
In the Value field, enter your non-www address (i.e. example.com).
Scroll down and click on the Save button.
Your website will now be accessible at both your www and non-www addresses.