In the OSS console, you can set up your buckets to work in static website hosting mode.
If your selected bucket is located in Hangzhou, after the configuration takes effect, the endpoint of the static website is as follows:
For users to manage static websites hosted on the OSS more easily, the OSS provides two functions:
Index Document Support
The index document refers to the default index document (such as index.html) that is returned by the OSS when a user directly accesses the root domain name of the static website. If static website hosting mode is set for a bucket, you must specify the index document as an object in that bucket. This setting is required.
Error Document Support
The error document refers to the error page the OSS returns to a user if the HTTP 4XX error (such as 404 "NOT FOUND") occurs when the user attempts to access the static website but fails. If static website hosting mode is set for a bucket, you must specify the error document as an object in that bucket. This setting is optional.
- The index document support as index.html
- The error document support as error.html
- The bucket as oss-sample
- The endpoint as
- When a user accesses
http://oss-sample.oss-cn-hangzhou.aliyuncs.com/directory/, it is the same as accessing
- When a user accesses
http://oss-sample.oss-cn-hangzhou.aliyuncs.com/object, and the object does not exist, OSS returns
- For access to a bucket-based static website through a user-defined domain name, see Bind custom domain names.
- When you set a bucket to static website hosting mode, you must specify an index page, the error page is optional.
- When you set a bucket to static website hosting mode, the specified index page and error page must be an object in the bucket.
- After a bucket is set to static website hosting mode, the OSS returns the index page for anonymous access to the root domain name of the static website, and returns Get Bucket results for signed access to the root domain name of the static website.
- After a bucket is set to static website hosting mode, and the user accesses the root domain name of a static website or a nonexistent object, the OSS returns a specified object to the user and bills the return traffic and requests to the bucket owner.