Search code examples
amazon-web-servicesamazon-s3amazon-route53static-site

Site domain redirecting to the url of amazon web services bucket


I have a static website which is currently being hosted in an AWS S3 bucket: mysite.com

I used GoDaddy to purchase the domain for mysite.com and I'm in the process of configuring this URL so that it points to my AWS S3 bucket. I believe I've configured the S3 bucket correctly as mysite.com.s3-website-us-east-1.amazonaws.com serves my static site.

However, I have a problem with my AWS Route 53. I set up a hosted zone with an alias, nameservers, and a start of authority.

My problem is that when I go to mysite.com in my browser, I am redirected to mysite.com.s3-website-us-east-1.amazonaws.com. The site is correctly served from that address but I'm wondering why I'm being redirected to the AWS url.

Update - This is the result of running curl -IXGET mysite.com in the terminal:

HTTP/1.1 200 OK
x-amz-id-2: FdG4UIjsT2AYvWlGZgtZFnUCoC5rlEpUoDWslfTiLxdtqfER5/VrK5pNaR0WgNQH+VtXvLM0dc0=
x-amz-request-id: D7F6E1CD65C36959
Date: Mon, 01 Aug 2016 17:46:39 GMT
Last-Modified: Tue, 26 Jul 2016 22:10:36 GMT
ETag: "c4388dce1539caba654edf75cc674b7e"
Content-Type: text/html
Content-Length: 10364
Server: AmazonS3

Solution

  • All I can suggest is to double-check Setting Up a Static Website Using a Custom Domain

    I just tested the same setup here, and the domain does not redirect.

    Under the S3 bucket properties, make sure the Redirect all requests to another host name is not set to an incorrect address.

    Make sure the Route 53 record is using an IP alias record, as shown in the tutorial.