GET /?website HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth String
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
, <BucketName-APPID> is the bucket name followed by the APPID, such as examplebucket-1250000000
(see Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Conventions), and <Region> is a COS region (see Regions and Access Endpoints).<WebsiteConfiguration><IndexDocument><Suffix>string</Suffix></IndexDocument><RedirectAllRequestsTo><Protocol>string</Protocol></RedirectAllRequestsTo><ErrorDocument><Key>string</Key></ErrorDocument><RoutingRules><RoutingRule><Condition><HttpErrorCodeReturnedEquals>integer</HttpErrorCodeReturnedEquals></Condition><Redirect><Protocol>string</Protocol><ReplaceKeyWith>string</ReplaceKeyWith></Redirect></RoutingRule><RoutingRule><Condition><KeyPrefixEquals>string</KeyPrefixEquals></Condition><Redirect><Protocol>string</Protocol><ReplaceKeyPrefixWith>string</ReplaceKeyPrefixWith></Redirect></RoutingRule></RoutingRules></WebsiteConfiguration>
Node Name (Keyword) | Parent Node | Description | Type |
WebsiteConfiguration | None | Stores the result of GET Bucket website . | Container |
WebsiteConfiguration
:Node Name (Keyword) | Parent Node | Description | Type |
IndexDocument | WebsiteConfiguration | Index document configuration | Container |
RedirectAllRequestsTo | WebsiteConfiguration | Redirection configuration for all requests | Container |
ErrorDocument | WebsiteConfiguration | Error document configuration | Container |
RoutingRules | WebsiteConfiguration | Routing rule configuration | Container |
IndexDocument
:Node Name (Keyword) | Parent Node | Description | Type |
Suffix | WebsiteConfiguration.IndexDocument | The object key suffix of index documents. For example, if this parameter is set to index.html , index.html will be automatically returned when you access the root directory of the bucket, and article/index.html will be returned when you access the article/ directory. | string |
RedirectAllRequestsTo
:Node Name (Keyword) | Parent Node | Description | Type |
Protocol | WebsiteConfiguration.RedirectAllRequestsTo | The target protocol to redirect all requests | string |
ErrorDocument
:Node Name (Keyword) | Parent Node | Description | Type |
Key | WebsiteConfiguration.ErrorDocument | Object key of the general error document | string |
RoutingRules
:Node Name (Keyword) | Parent Node | Description | Type |
RoutingRule | WebsiteConfiguration.RoutingRules | A single routing rule | Container |
RoutingRules.RoutingRule
:Node Name (Keyword) | Parent Node | Description | Type |
Condition | WebsiteConfiguration.RoutingRules.RoutingRule | Condition for the routing rule | Container |
Redirect | WebsiteConfiguration.RoutingRules.RoutingRule | Configuration of the redirection target | Container |
RoutingRules.RoutingRule.Condition
:Node Name (Keyword) | Parent Node | Description | Type |
HttpErrorCodeReturnedEquals | WebsiteConfiguration.RoutingRules.RoutingRule.Condition | The error code to match the routing rule | integer |
KeyPrefixEquals | WebsiteConfiguration.RoutingRules.RoutingRule.Condition | The object key prefix to match the routing rule | string |
RoutingRules.RoutingRule.Redirect
:Node Name (Keyword) | Parent Node | Description | Type |
Protocol | WebsiteConfiguration.RoutingRules.RoutingRule.Redirect | Target protocol for the routing rule | string |
ReplaceKeyWith | WebsiteConfiguration.RoutingRules.RoutingRule.Redirect | Target object key to replace the original object key in the request | string |
ReplaceKeyPrefixWith | WebsiteConfiguration.RoutingRules.RoutingRule.Redirect | Target object key prefix to replace the original object key prefix that is matched in the request | string |
GET /?website HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Wed, 20 May 2020 09:33:49 GMTAuthorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1589967229;1589974429&q-key-time=1589967229;1589974429&q-header-list=date;host&q-url-param-list=website&q-signature=50a22a30b02b59e5da4a0820d15a36805ea7****Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 1163Connection: closeDate: Wed, 20 May 2020 09:33:49 GMTServer: tencent-cosx-cos-request-id: NWVjNGY5N2RfYTdjMjJhMDlfNjZkY18yYWUx****<WebsiteConfiguration><IndexDocument><Suffix>index.html</Suffix></IndexDocument><RedirectAllRequestsTo><Protocol>https</Protocol></RedirectAllRequestsTo><ErrorDocument><Key>pages/error.html</Key></ErrorDocument><RoutingRules><RoutingRule><Condition><HttpErrorCodeReturnedEquals>403</HttpErrorCodeReturnedEquals></Condition><Redirect><Protocol>https</Protocol><ReplaceKeyWith>pages/403.html</ReplaceKeyWith></Redirect></RoutingRule><RoutingRule><Condition><HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals></Condition><Redirect><ReplaceKeyWith>pages/404.html</ReplaceKeyWith></Redirect></RoutingRule><RoutingRule><Condition><KeyPrefixEquals>assets/</KeyPrefixEquals></Condition><Redirect><ReplaceKeyWith>index.html</ReplaceKeyWith></Redirect></RoutingRule><RoutingRule><Condition><KeyPrefixEquals>article/</KeyPrefixEquals></Condition><Redirect><Protocol>https</Protocol><ReplaceKeyPrefixWith>archived/</ReplaceKeyPrefixWith></Redirect></RoutingRule></RoutingRules></WebsiteConfiguration>
문제 해결에 도움이 되었나요?