10

Is it possible to do that? I need to be able to access mydomain.com by typing in my-domain.com in the address bar of the browser?

Now I added a DNS entry:

my-domain.com CNAME mydomain.com

But this doesn't seem to work. I get an 404 not found error.

Geoff Appleford
  • 17,742
  • 4
  • 58
  • 83
pimenz
  • 101
  • 1
  • 3
  • 1
    You can create a second empty S3 bucket for "my-domain.com" and configure it to redirect to the domain "mydomain.com". Then just use the same DNS settings to point both to the Amazon S3 domain for the bucket with all your static HTML files. – Andrew Bucklin Oct 21 '15 at 02:04
  • @AndrewBucklin, this is actually how aws recommends doing it. Step 2.2 https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-s3-tasks – dier Apr 21 '18 at 15:39

2 Answers2

7

You can only map a single domain to your S3 bucket. However you could use Cloudfront to do this.

See my answer to another similar question for more information.

Community
  • 1
  • 1
Geoff Appleford
  • 17,742
  • 4
  • 58
  • 83
0

We had the same issue and basically I set our CI to publish to two S3 buckets on release. Not ideal but keeps you clear from resetting caches in CloudFront on publish for the short term.

Joseph Juhnke
  • 824
  • 9
  • 9