Default to index.html in Spaces
complete
Fryguy
Navigating with a browser to a spaces bucket yields a terrible looking giant XML file. What I'd like is to be able to host an index.html file in the space, and have navigation to / default to /index.html.
This idea has been discussed for years [1], and while it was claimed to be worked on, it was never completed. This is a hugely important feature for a lot of people.
W
Whitney Jutzin
complete
W
Whitney Jutzin
closed
Thank you again for this feedback! This is now something available within Spaces, though we still encourage you to look at App Platform for this functionality. Here's how:
Here are the steps:
- Install the AWS CLI
- Generate a DigitalOcean Spaces API Key
- Find the Spaces S3-Compatible Endpoint
- run "aws configure" and enter your Spaces API credentials
Then to enable Enable static website
- upload static website to Spaces bucket
aws s3api put-bucket-website --bucket jkpe-website --endpoint=https://ams3.digitaloceanspaces.com --website-configuration file://website.json
And here's an example website.json contents:
{
"IndexDocument": {
"Suffix": "index.html"
},
"ErrorDocument": {
"Key": "error.html"
}
}-
The static website will then be available at Static website is then available at this URL format:
<bucket-name>.<region>-static.digitaloceanspaces.com (note the "-static" addition).
If you need more help getting started with this, please reach out to our support team: https://cloudsupport.digitalocean.com/s/
W
Whitney Jutzin
Thank you for this great feedback! Default web pages and static website hosting can be done via App Platform's Static Sites feature. This will get your code loading just as you like it. Please check out this page for more details: https://digitalocean.canny.io/storage/p/default-to-indexhtml-in-spaces As always, reach out to our support team if you need any assistance setting this up: https://cloudsupport.digitalocean.com/s/