Skip to content
Console

Static websites and domains

S4 can host static websites: it returns the home page file when a directory is requested and returns your 404 page when a path doesn't exist. To serve your own domain publicly, connect a CDN.

To get there, go to Object Storage (对象存储) › Bucket list (桶列表) › click the bucket name › Website settings (网站设置).

Creating new bucket domains is paused. Since May 10, 2026, buckets can no longer bind new domains directly, and clicking New bucket domain (新建桶域名) shows "该功能已暂停" (this feature is paused). Use a CDN domain instead. Domains that are already bound keep working and can still be managed.

Deploy a static website

Upload the website files

Upload your build output to the bucket, for example index.html, 404.html, and assets/. See Upload files.

Set the default files

In Default file configuration (默认文件配置), click Edit (编辑), enter index.html for Home page file key (首页文件key) and 404.html for 404 file key (404文件key), and save.

Connect a CDN

In Static acceleration management (静态加速管理), add your domain, choose this bucket as the origin, and complete the CNAME record and HTTPS. See Add and manage CDN domains.

Verify

Open https://your-domain/. It should return the content of index.html.

A CDN that uses an S4 bucket as its origin can read a private bucket, so the website doesn't need the bucket to be public. If your website lives in a subdirectory of the bucket, set an origin fetch path prefix in the CDN's origin and origin fetch settings.

Default file configuration

This is the default for the whole bucket. It applies to access through CDN domains and bound bucket domains. It doesn't apply when you access through the bucket default domain (bucket-name.s3.bitiful.net).

Your account balance must be greater than 0 to edit it. Otherwise you see "当前账户余额不足,请充值后再配置默认文件" (the account balance is insufficient; top up before configuring default files).

Home page file keytext

The file name returned when the domain root or a directory path is requested, for example index.html. Leave it empty to disable.

404 file keytext

The file returned when the requested object doesn't exist, as a full path from the bucket root, for example 404.html. When empty, S4 returns its built-in 404 page.

Return 404 status codeswitchDefault Off

On: The status code is 404 when the 404 file is returned. Off: Returns 200, as the file itself would. Single-page apps usually need this off. You can turn it on only after you enter a 404 file key.

Rules for file keys: can't begin with /; can't contain .., ?, #, \, or invisible characters; up to 256 bytes.

Changes take effect immediately after you save. The CDN may still return old cached content, so you need to purge the cache.

Access rules

Take the home page index.html and the 404 page 404.html as an example:

Request pathWhat's in the bucketResult
/Has index.htmlReturns index.html
/docs/Has docs/index.htmlReturns docs/index.html
/docsdocs is a directory302 redirect to /docs/
/docs/The directory exists but has no docs/index.htmlReturns the 404 page
/a.pngHas a.pngReturns a.png
/noneDoesn't existReturns the 404 page
/private/a.pngAccessed through a bucket domain, and the directory isn't public403, not the 404 page

The home page file is appended after every directory level, so enter only a file name, not a path such as site/index.html.

When no home page is set, requesting a directory doesn't list its files.

Typical configurations

Website typeHome page file key404 file keyReturn 404 status code
Single-page app (React, Vue, etc., using history routing)index.htmlindex.htmlOff
Docs site or blog (multi-page)index.html404.htmlOn
Image host or download siteEmptyEmptyOff

After you point the 404 of a single-page app to index.html, missing images and scripts also get 200 and the home page content. When you publish a new version, upload the asset files first, then update index.html.

Bound bucket domains

The Bound domains (绑定域名) table lists the domains bound earlier:

ColumnDescription
Domain (域名地址)Your domain
Path prefix (路径前缀)The directory in the bucket that the domain root maps to. Bucket root (桶根目录) means none is set
CNAME domain (CNAME域名)The address it must resolve to. A green icon means it has taken effect and red means it hasn't. When HTTPS is on but no certificate is selected, it also shows the DNS record that the auto certificate needs
HTTPS configuration (HTTPS配置)Whether it's on, and the certificate validity period

Right after you change DNS, the status may lag by a few minutes. Click Refresh list (刷新列表) to check.

Manage a domain

Click Manage domain (管理域名) to configure HTTPS and the website.

HTTPS configuration

Click Edit, turn on HTTPS, choose a certificate that's already deployed in the Certificate Center from the Certificate (证书) drop-down, and save. The certificate must match the domain.

When you turn on HTTPS, HTTP/2 and OCSP are on by default, and TLS 1.0 ~ 1.3 are supported.

Website settings

Click Edit to set:

  • Path prefix: The directory in the bucket that the domain root maps to. For example, with site/v2/, https://www.example.com/index.html reads site/v2/index.html in the bucket. Empty means the bucket root. The rules are the same as for public read directories: up to 512 bytes, and * isn't supported.
  • Home page file key and 404 file key: Enter them relative to the path prefix. When empty, the bucket's default file configuration applies.
  • Return 404 status code: Same meaning as above.

After you set a path prefix:

  • The domain is read-only and handled only as a website. It can't upload, delete, or list objects.
  • It can access only files within the prefix.
  • Read permission is still determined by public read. Saving the settings here doesn't change permissions, and the page tells you which directories aren't public.
  • Presigned access: sign the full object key (including the prefix) with the bucket default domain, then replace the link's domain with this domain and remove the prefix at the start of the path. SigV2 signatures aren't supported.

Delete a domain

Click Delete (删除) and confirm, and the domain stops serving immediately. Because creating new ones is paused, you can't bind it again after deleting, so switch the domain to a CDN before you delete it.

Migrate to a CDN

Add a CDN domain

In Static acceleration management, add the same domain, choose the original bucket as the origin, and deploy a certificate. If you had set a path prefix, enter the same origin fetch path prefix in the CDN's origin and origin fetch settings.

Switch DNS

Change the domain's CNAME to the address the CDN provides.

Confirm, then delete

After DNS has fully taken effect and access works, delete the old bucket domain.

Website settings on a bucket domain aren't carried over to the CDN automatically. Access through a CDN uses the bucket's Default file configuration, so set it up first.

FAQ

The root path returns 403 or a file list

No Home page file key is set, or you're using the bucket default domain. The bucket default domain doesn't support website features.

The site still shows old content after an update

CDNs and browsers cache content. Purge the cache after you publish, and use hashed file names for static assets.

The page downloads instead of opening
  1. Confirm you're using your own domain, not the bucket default domain.
  2. Check that the file's Content-Type is text/html.
Does a domain in mainland China need ICP filing?

Yes. A domain that uses mainland China CDN nodes must complete ICP filing.