put-bucket-website

Set the website configuration for a bucket.

See also: PUT Bucket Website.

Synopsis

put-bucket-website
  --bucket <value>
  [--content-md5 <value>]
  --website-configuration <value>
  [--cli-input-json <value>]

Options

--bucket (string)

--content-md5 (string)

--website-configuration (structure)

JSON Syntax:

{
  "ErrorDocument": {
    "Key": "string"
  },
  "IndexDocument": {
    "Suffix": "string"
  },
  "RedirectAllRequestsTo": {
    "HostName": "string",
    "Protocol": "http"|"https"
  },
  "RoutingRules": [
    {
      "Condition": {
        "HttpErrorCodeReturnedEquals": "string",
        "KeyPrefixEquals": "string"
      },
      "Redirect": {
        "HostName": "string",
        "HttpRedirectCode": "string",
        "Protocol": "http"|"https",
        "ReplaceKeyPrefixWith": "string",
        "ReplaceKeyWith": "string"
      }
    }
    ...
  ]
}

--cli-input-json (string)

Operates a service or services based on the provided JSON string. If other arguments are provided on the command line, the CLI values override the JSON-provided values. You cannot pass arbitrary binary values using a JSON-provided value, because the string is taken literally.

Examples

The applies a static website configuration to a bucket named “my-bucket”:

$ aws s3api put-bucket-website --bucket my-bucket --website-configuration file://website.json

The file website.json is a JSON document in the current folder that specifies index and error pages for the website:

{
    "IndexDocument": {
        "Suffix": "index.html"
    },
    "ErrorDocument": {
        "Key": "error.html"
    }
}

Output

None