Reputation: 531
Recently I tried to host my website on Amazon s3 by following steps on http://docs.aws.amazon.com/gettingstarted/latest/swh/getting-started-configure-route53.html ..On Step 5 I created Alias which will route to endpoint. Now, On typing www.example.com it is redirecting to http://example.com.s3-website-ap-southeast-1.amazonaws.com/index.html instead of www.example.com/index.html
How can I route only for example.com instead of endpoint?
Upvotes: 0
Views: 835
Reputation: 64741
The referenced getting started example how to Associate a Domain Name with Your Website Using Amazon Route 53 is using the increasingly preferred approach to host a website on the domain root, likely because it is slightly more involved and support for this via Route 53 Alias Resource Record Sets being worth mentioning/showcasing.
The Amazon S3 developer guide also features an example for Setting Up a Static Website Using a Custom Domain, which is a bit more explicit about the arbitrary choice which of your two buckets will be the redirection target, see Step 2: Create Two Buckets:
In this example, to support requests from both the root domain such as example.com and subdomain such as www.example.com, you will create two buckets. One bucket will contain the content and you will configure the other bucket to redirect requests. [...] [emphasis mine]
All you need to do is to effectively inverse the configuration instructions for example.com
vs. www.example.com
(starting from step 2.1.3) to redirect requests from the former root domain bucket to the latter instead of the other way round.
Upvotes: 1
Reputation: 179084
Yout problem appears to be in the prior step.
In the Redirect all requests to box, type the name of your root domain.
The behavior you describe would occur if, instead of just the desired target, "example.com," you entered the entire S3 web endpoint hostname (e.g., example.com.s3-website-ap-southeast-1.amazonaws.com) there.
Upvotes: 0