You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Static Website
GetBucketWebsite
Copy page
Download PDF
GetBucketWebsite
Description​
This interface retrieves the website configuration of the specified bucket.​
Notes​
You must be the bucket owner or have GetBucketWebsite permission authorized for the current bucket to call this interface.​
Request syntax​
​
GET /?website HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: authorization string​
​
Request parameters and headers​
This request uses common request headers; see Common parameters.​
​
Name​
Location​
Type​
Required​
Sample value​
Note​
website​
Query​
String​
Yes​
-​
Special identifier representing the GetBucketWebsite request.​
​
Request body elements​
No elements are used in this request.​
Response headers​
The public response headers returned by this request. See Public parameters.​
Response body elements​
Redirect all requests​
​
Name​
Type​
Sample value​
Note​
RedirectAllRequestsTo​
Object​
-​
Redirect all requests; once set, no other redirect rules can be configured.​
HostName​
String​
example.com​
Redirected site name.​
Parent node: RedirectAllRequestsTo​
Protocol​
String​
http​
The protocol used for the redirect request, supporting http and https protocols. Defaults to using the http protocol.​
Parent node: RedirectAllRequestsTo​
​
Redirect rules​
  • Default homepage IndexDocument​
​
Name​
Type​
Sample value​
Note​
IndexDocument​
Object​
-​
Set default homepage.​
Suffix​
String​
index.html​
When requesting a directory (ending with /), return objects with the specified Suffix under that directory. For example, if Suffix is set to index.html, accessing document/ returns document/index.html.​
Parent node: IndexDocument​
ForbiddenSubDir​
Bool​
false​
Whether to support redirecting to the default homepage of a subdirectory; the description is as follows:​
  • false (Default): Does not support redirecting to the default homepage of a subdirectory.​
  • true: Supports redirecting to the default homepage of a subdirectory.​
Parent node: IndexDocument​
​
  • Error page ErrorDocument​
​
Name​
Type​
Sample value​
Note​
ErrorDocument​
Object​
-​
Set the error page.​
Key​
String​
error.html​
Return this page when a 4xx error occurs.​
Parent node: ErrorDocument​
​
  • Redirect rules RoutingRules​
​
Name​
Type​
Example value​
Note​
RoutingRules​
Array​
-​
Set the redirect rule.​
Condition​
Object​
-​
Set matching conditions for redirect rules. The redirect rule takes effect only when all set conditions match.​
Parent node: RoutingRules​
HttpErrorCodeReturnedEquals​
Integer​
404​
Sets the HTTP error code that triggers the redirect. For example, if HttpErrorCodeReturnedEquals is set to 404, the rule takes effect when the specified object does not exist.​
If KeyPrefixEquals is set, the redirect rule applies only when both conditions match.​
Parent node: Condition​
KeyPrefixEquals​
String​
red/​
Set the object name prefix when the redirect rule takes effect.​
If HttpErrorCodeReturnedEquals is set, the redirect rule only applies when both conditions match.​
Parent node: Condition​
Redirect​
Object​
-​
Set redirection rules.​
Parent node: RoutingRules​
HostName​
String​
example.com​
Set the site name for redirection.​
Parent node: Redirect​
HttpRedirectCode​
Integer​
301​
The status code returned during redirection can only be a 3XX error code, excluding 300. The default is 301.​
Parent node: Redirect​
Protocol​
String​
http​
The protocol used for redirection requests, supporting http and https. http protocol is used by default.​
Parent node: Redirect​
ReplaceKeyPrefixWith​
String​
redirect/​
Object name prefix used for redirection.​
Cannot be set simultaneously with ReplaceKeyWith.​
Parent node: Redirect​
ReplaceKeyWith​
String​
redirect.html​
Object name used during redirection.​
Cannot be set simultaneously with ReplaceKeyPrefixWith.​
Parent node: Redirect​
​
Sample request​
​
GET /?website HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: authorization string​
​
Sample response​
​
HTTP/1.1 200 OK​
Date: Fri, 30 Jul 2021 13:53:55 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
Content-Length: 643​
​
{​
"IndexDocument": {​
"Suffix": "index.html"​
},​
"ErrorDocument": {​
"Key": "error.html"​
}​
}​
​
​
Last updated: 2026.08.03 10:30:53