Help Center/ Object Storage Service/ SDK Reference/ C/ Data Types/ bucket_website_routingrule
Updated on 2026-08-03 GMT+08:00

bucket_website_routingrule

Table 1 bucket_website_routingrule

Parameter

Type

Mandatory (Yes/No)

Description

key_prefix_equals

const char *

Yes

Explanation:

Indicates the object name prefix which the redirection applies to.

For example, to redirect the requests for the object ExamplePage.html, set key_prefix_equals to ExamplePage.html.

Restrictions:

None

Value range:

None

Default value:

None

http_errorcode_returned_equals

const char *

Yes

Explanation:

The HTTP error code for redirection to take effect. If an error code returned is the same as the value specified for this parameter, the redirection rule takes effect.

Examples:

If you want to redirect requests to NotFound.html when an HTTP error code 404 is returned, set http_errorcode_returned_equals to 404 and replace_key_with to NotFound.html.

Restrictions:

None

Value range:

None

Default value:

None

protocol

const char *

Yes

Explanation:

Indicates the protocol (http or https) used for redirecting requests.

Restrictions:

None

Value range:

None

Default value:

None

host_name

const char *

Yes

Explanation:

Indicates the name of the host where requests will be redirected.

Restrictions:

None

Value range:

None

Default value:

None

replace_key_prefix_with

const char *

Yes

Explanation:

The object name prefix used in the redirection. OBS replaces the value of key_prefix_equals with the value of replace_key_prefix_with.

Restrictions:

None

Value range:

None

Default value:

None

replace_key_with

const char *

Yes

Explanation:

The object name prefix used in the redirection. OBS replaces the entire object name in the request with the value of replace_key_with.

Restrictions:

None

Value range:

None

Default value:

None

http_redirect_code

const char *

Yes

Explanation:

Indicates the HTTP status code returned for the redirection request.

Restrictions:

None

Value range:

None

Default value:

None