8

I have followed the instructions that Amazon has provided for website hosting using s3 buckets here.

I have created two S3 buckets, one named MyWebsite.com and a second one named www.MyWebsite.com. In S3, I have configured the latter of the two buckets to redirect to the former, as shown in the example.

I am using Route53 to set Alias record sets for the www and non-www domain. My Record Sets are as follows:

Name: MyWebsite.com, Alias Target: s3-website-us-west-1.amazonaws.com.

Name: www .MyWebsite.com, Alias Target: s3-website-us-west-1.amazonaws.com.

Accessing the non-www domain, MyWebsite.com works fine, but when I try accessing www.MyWebsite.com, I am redirected to the invalid url:

http://http//MyWebsite.com.s3-website-us-west-1.amazonaws.com/

Where is the extra "http//" (without a colon) coming from and how can I prevent it?

Edit: Actual website name is thinkingdots.com

tedtoy
  • 168
  • 2
  • 12
  • 2
    Can you let us know the domain name? It sounds like a DNS issue but I'm not positive. – stdunbar Sep 06 '17 at 15:05
  • Sure, my domain is http://thinkingdots.com – tedtoy Sep 06 '17 at 15:15
  • 4
    On my side it looks just fine - the `www` site does a 301 redirect to the non-www site. The non-www site sends a little bit of HTML. If it's still doing it for you then perhaps you have something cached in either the browser or in your DNS cache. Try to use an incognito browser window and/or wait for your DNS cache to expire. – stdunbar Sep 06 '17 at 15:34
  • 2
    Oh wow, you are right. It seems to be a caching issue, works fine in incognito... Thank you for taking a look at it though! – tedtoy Sep 06 '17 at 15:36
  • Wow! Caching issue. I was running around in circles for the last couple of hours on why things weren't working for me and going incognito worked fine. Thanks! – Felipe Nov 15 '21 at 05:56

1 Answers1

0

I'm not sure you actually need two s3 buckets here. I'm assuming you have a single deployment of the website on MyWebsite.com.s3-website-us-west-1.amazonaws.com/?

AWS has a constraint where the A record on Route53 for MyWebsite.com has to match the naming convention for the s3 bucket - which in this case is the "naked domain name" (i.e. no subdomain).

For www.MyWebsite.com, I believe you need to create a CNAME record on Route53 associating it with MyWebsite.com

John Sibly
  • 22,782
  • 7
  • 63
  • 80