Exercise 5.4 – Setting up static website hosting
In this exercise, we will configure the bucket to host a static website. When configured with a static website hosting service, the bucket will be configured with a website endpoint that you can distribute to your users, who can then access all the pages (assuming they are linked) using the standard HTML protocol.
To configure your bucket for static website hosting, you need a minimum of two files— an index.html
file and an error.html
file. An error file is simply a file that the S3 static website hosting service will redirect to if there is a problem with the index.html
file—for example, if it cannot find the index.html
page. You could use the error.html
file to broadcast the fact that perhaps the site is under maintenance. Proceed as follows:
- Create a new HTML file using your text editor as before (either Notepad on Windows or TextEdit on a Mac). However, in this file, simply add a line of text along...