I have an extremely simple website, literally just an HTML file with some text in it. I configured my bucket for hosting and set the homepage to index.html. I set the permissions per the AWS tutorial here: https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
For some reason, when I hit the website endpoint, Chrome is prompted to save a file called "download". If I save the file and open it, it is just blank, zero bytes. Why is my index.html file not served up?
UPDATE: I fixed the empty file issue, but it still wants to download my page instead of open it in the browser...
FIXED: The content-type was set incorrectly. When uploading the file, I had to explicitly the set the content type property to text/html or text/css.
You need to set the Metadata properly - content-type
as text/html
for your html pages. Once this is through the browser would start to render the pages in the browser rather than downloading them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With