0

I have a normal s3 bucket (not set up to serve a static website) and cloudfront.

I want to make it so that any request that is not for a specific resource serves the same default index.html file. Is this correct/

In other words, requests to

www.example.com/file.jpg -> returns file.jpg
www.example.com/ -> returns index.html
www.example.com/thing/test -> *the same index.html file as above*

Is there a way to map a wildcard for all non-matched paths like this?

This answer almost addresses the point but I do not have a "static" domain so I am not sure how I can use this.

I appreciate any input

Community
  • 1
  • 1
Startec
  • 12,496
  • 23
  • 93
  • 160

1 Answers1

0

It appears that Amazon CloudFront is able to Customize Error Responses:

If you'd rather display a custom error message, possibly using the same formatting as the rest of your website, you can have CloudFront return to the viewer an object (for example, an HTML file) that contains your custom error message.

Custom error response
(source: amazon.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470