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>