# RedirectTarget

Specifies a redirect behavior of all requests to a website endpoint of a bucket.

- Source: [`aws-s3/lib/bucket.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L1317)

## Example

```ts
const bucket = new s3.Bucket(this, 'MyRedirectedBucket', {
  websiteRedirect: { hostName: 'www.example.com' },
});
```

## Properties

- `hostName`: string (required) — Name of the host where requests are redirected.

- `protocol`: [RedirectProtocol](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.RedirectProtocol.html) — Protocol to use when redirecting requests.

  **Default:** The protocol used in the original request.
