We are using cloudfront for one of our website. So, to work with cloudfront we have setup s3 bucket and added all files in it. Then to use custom domain we have created a record set in Route53 and given cloudfront url. This everything is working fine.
However, we are facing redirection OR page refresh issue for our site. Let say if we are on some inner page 'https://www.example.com/my-page' and we refresh the page then page is not displayed and we are getting below error.
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>my-page</Key>
<RequestId><some-request-id></RequestId>
<HostId><some-host-id></HostId>
</Error>
And this issue is occurring for all pages.
i have tried setting redirect url for s3 bucket; but it seems it always redirect to login page.
Any help on this appreciated !