0
votes

I've seen a lot of manuals about this question and especially AWS' official docs but it doesn't work for me and I cann't understand why.

  1. I created two buckets mydomain.com and www.mydomain.com.
  2. I added bucket policy to mydomain.com:

    { "Version": "2012-10-17", "Statement": [ { "Sid": "AddPerm", "Effect": "Allow", "Principal": "", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mydomain.com/" } ] }

  3. I enabled "Enable website hosting" for mydomain.com and put index.html there. So I've got endpoint for it mydomain.com.s3-website-us-east-1.amazonaws.com which good in opening index.html.

  4. I enabled "Redirect all requests to another host name" for www.mydomain.com to mydomain.com.s3-website-us-east-1.amazonaws.com. But according to AWS' official I should do redirect to mydomain.com. But it doesn't work for me, and my way of redirect does. Anyway now www.mydomain.com.s3-website-us-east-1.amazonaws.com opens index.htm in mydomain.com.s3-website-us-east-1.amazonaws.com.

  5. Mydomain registred with AWS route53, so I went there and created A Alias to s3-website-us-east-1.amazonaws.com exacly like in docs. I have been waiting for 24 hours, but nothing changes...

    mydomain.com goes to nowhere... Help, please.

1

1 Answers

0
votes

The basics of what you are doing seem right; however, I suspect you missed a step and it is hard to tell where without seeing the actual records/configs.

For example, if the site is static and on cloudfront, make sure that you set the 'alternate domain name' in cloudfront to mydomain in addition to pointing your domain there.

Also, it would be helpful to know if your route53 entry is resolving to an address which is simply not responding, or if the route53 domain is not resolving at all. To do that, you would do an nslookup on mydomain and post the results.

Also, see these, they might help: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html