'How to route in Route53 from non-WWW to WWW?

I've seen all the solutions for this kind of questions, but they are all related with S3 bucket solutions. These solutions does not fit my issue, because I don't see how S3 bucket is related with it.

Anyway, I have a domain name www.example.com. I use an A Record to route it to my ALB. Works fine. By now, I had some configuration for example.com (routed via A Record to ALB). But this practice is considered bad because SEO considers these 2 domains as 2 different pages.

So What I need is to redirect(?) example.com to www.example.com.

I tried configure PTR Routing type on example.com to www.example.com but that's just doesn't work. When I do so I get "DNS_PROBE_FINISHED_NXDOMAIN".

What is the correct way to do so?



Solution 1:[1]

For this, you can also create a CNAME record with host as www and value is your LB or IP.

Regards

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ansh Bhatia