0

I have a website, for example xyz.online hosted on S3.I have 2 buckets in s3, one is xyz.online which contains all the files, and the other one is www.xyz.online which redirects to the first bucket.

Now to shift to HTTPS protocol, I am using ACM(Amazon Certificate Manager), for my domain(xyz.online) and the additional subdomain(www.xyz.online), and verified it by adding the CNAMES for both in my NameCheap account, and the certificate was issued successfully.Then I created a CloudFront distribution network, using this certificate, redirecting HTTP to HTTPS, and index.html as root object.(followed these instructions from here).

The problem I am facing is that www.xyz.online and xyz.online, both successfully redirect to https://xyz.online/home, but when I refresh the page or try to enter https://xyz.online/home directly , it displays an error.I cannot find out where the issue is.

I tried using the CloudFront url directly, https://qwerty.cloudfront.net/home, the same error page appears, it is given below

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>home</Key>
<RequestId>***********</RequestId>
<HostId>*******</HostId>
</Error>
  • Define, doesn't load – Chris Williams May 30 '20 at 12:35
  • error page is displayed – Mandeep May 30 '20 at 12:56
  • Could you clarify. You are redirecting `xyz.online` to `https://xyz.online/home`? What is `home` and how are you doing this redirection? The tutorial you've linked does not demonstrate such redirection. – Marcin May 30 '20 at 13:00
  • The traffic goes to https://xyz.online, but within my website, the default path 'home' is appended.So if I enter 'xyz.online 'it is able to render the site as 'https://xyz.online/home', and the default url '/home' opens, but I am unable to do so by entering 'xyz.online/home', this path is somehow interfering – Mandeep May 30 '20 at 13:05
  • Which error page? Please be as specific as you can be :) – Chris Williams May 30 '20 at 13:07
  • @mokugo-devops i have added it in the question – Mandeep May 30 '20 at 13:10
  • I found the answer in this post, now it works fine ! https://stackoverflow.com/questions/34060394/cloudfront-s3-website-the-specified-key-does-not-exist-when-an-implicit-ind – Mandeep May 31 '20 at 12:09

1 Answers1

0

This error is caused by the S3 bucket for the origin not having a file, either name home or home/index.html.

Chris Williams
  • 32,215
  • 4
  • 30
  • 68