Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add WWW to domain in AWS Route53?

I have created a Record Set

Name: www.nevermind.com.
Type: A
Alias Target: nevermind.com.

nevermind.com is working but www.nevermind.com is not working.

I get an error: 404 Not Found

update: I'm using s3 service to host my code.

Any ideas?

like image 692
Dmitry Grinko Avatar asked Dec 10 '22 06:12

Dmitry Grinko


1 Answers

For s3 hosted websites - to enable the www subdomain for your domain, you need to do the following -

  • Create another s3 bucket with your subdomain name - www.nevermind.com

  • In the www.nevermind.com bucket choose properties -> static website hosting -> choose redirect requests -> in target bucket/domain put your domain "nevermind.com"

  • save

  • In route53 DNS record, create a new record set -> enter "www" for the Name -> select Alias: "Yes" -> use the "www.nevermind.com" s3 bucket alias endpoint.

After this, your www.nevermind.com should redirect to nevermind.com.

like image 149
mdeora Avatar answered Jan 04 '23 16:01

mdeora