Search code examples
amazon-web-serviceshttp-redirectdnsamazon-route53domain-name

AWS redirect .net, .co.uk and .org to .com


I own multiple domains (.com, .co.uk, .net, .org) which all have the same name. These domains are registered at 123-reg (https://www.123-reg.co.uk/). I am hosting a static website in AWS using S3 + Cloudfront and I've set up alias records for .com in Route 53. All is working fine but I want to be able to redirect all the other, non-.com domains to .com.

I have seen this article on AWS support but the 'Redirect requests' option in S3 only allows you to specify one target domain which does not help me.

enter image description here

Currently I am using the 'Use this bucket to host a website' option FYI.


Solution

  • The article mentioned is correct. You'll have to create a new s3 bucket for each new domain url and setup the Redirect requests for each new bucket.

    1. Create new S3 Buckets that have the same name as the domain name
    2. Create multiple route53 records that point to the S3 buckets
    3. For each bucket, go to properties, static website hosting and setup redirect requests.

    And this should work.