Ronald Repolona
Ronald Repolona

Reputation: 71

Broken image and css on AWS Cloudfront Custom Error Page

i'm having problem with setting up cloudfront custom error pages for our site. yes, the custom error pages works. but css and images are all broken.

i follow exactly what this link tells me to do From better engineering site

for us to do an actual test, we temporarily disable the apache service in ec2 server so the site will be redirected to the custom error page (uploaded in our s3 bucket). the custom error page works, but not sure the css and image is broken.

anyone, have this same problem before?

thank you in advance for your help

Upvotes: 2

Views: 669

Answers (2)

cgon
cgon

Reputation: 1981

I have ended up using a single html file with an iframe in it. The iframe contains the source of my error page which is a public s3 bucket.

Upvotes: 0

Ronald Repolona
Ronald Repolona

Reputation: 71

A workaround to fixed the broken image and css, is by merging it to 1 html only. instead of having 3 separate files (1 for html, 1 for css, and 1 image), what i did is combine them as 1 html. so instead of referencing css file i just use , and convert the image to base64.

the cons, is the html rows will be more longer. but it works!

Upvotes: 2

Related Questions