AWS S3 redirect https to a new domain

amazon s3amazon-route53amazon-web-servicesredirect

So I am changing the domain for my website to another. Because some users might have it bookmarked I need to redirect from old domain to new domain. They all use https.
I tried creating a S3 bucket in Amazon and Route 53 to redirect (https://aws.amazon.com/premiumsupport/knowledge-center/redirect-domain-route-53/) and it works fine for my old domain in http, however my server has a redirect rule from http to https so must likely users have bookmarked the https address.

In this case,
http://olddomain.com redirects fine to https://newdomain.com
but
https://olddomain.com presents an error (it doesn't load, "This site can’t be reached").

I looked through the AWS documentation and it says that S3 can't redirect from https.
Is there a workaround for this?

Thank you in advance.

Best Answer

Instead of doing a bucket redirect, create a CNAME or Alias record in your old domain DNS records which points to your new domain.

See here: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html

Related Topic