2

I am using S3 static website hosting to deploy code. I want to send 200 status code when error document is served. currently, it is sending 404 status code. Is it possible to customize the status code.

I can't see any option here to set HTTP status code

I can't see any option here to set HTTP status code.

Thanks in advance !!

Shivam Kubde
  • 545
  • 1
  • 8
  • 17
  • 200 status is not for error document why you want it?? – Prabhjot Singh Kainth Dec 13 '19 at 09:14
  • Yes I know. I have a special case :d. My index.html file is getting served as error document. You can read first answer from this link https://stackoverflow.com/questions/56345645/static-website-hosted-in-s3-pages-return-404-after-refresh to get more idea why index.html is getting served as error document – Shivam Kubde Dec 13 '19 at 10:06

1 Answers1

1

You can do by following step :

  1. Open CloudFront and select relevant CloudFront
  2. Go to Error Page tab
  3. Create custom page error handling as it showing images below

enter image description here

enter image description here

Avinash Dalvi
  • 8,551
  • 7
  • 27
  • 53