

# DeleteBucketWebsite
<a name="API_DeleteBucketWebsite"></a>

**Note**  
This operation is not supported for directory buckets.

This action removes the website configuration for a bucket. Amazon S3 returns a `200 OK` response upon successfully deleting a website configuration on the specified bucket. You will get a `200 OK` response if the website configuration you are trying to delete does not exist on the bucket. Amazon S3 returns a `404` response if the bucket specified in the request does not exist.

This DELETE action requires the `S3:DeleteBucketWebsite` permission. By default, only the bucket owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users permission to delete the website configuration by writing a bucket policy granting them the `S3:DeleteBucketWebsite` permission. 

For more information about hosting websites, see [Hosting Websites on Amazon S3](https://docs.amazonaws.cn/AmazonS3/latest/dev/WebsiteHosting.html). 

The following operations are related to `DeleteBucketWebsite`:
+  [GetBucketWebsite](https://docs.amazonaws.cn/AmazonS3/latest/API/API_GetBucketWebsite.html) 
+  [PutBucketWebsite](https://docs.amazonaws.cn/AmazonS3/latest/API/API_PutBucketWebsite.html) 

**Important**  
You must URL encode any signed header values that contain spaces. For example, if your header value is `my file.txt`, containing two spaces after `my`, you must URL encode this value to `my%20%20file.txt`.

## Request Syntax
<a name="API_DeleteBucketWebsite_RequestSyntax"></a>

```
DELETE /?website HTTP/1.1
Host: {{Bucket}}.s3.amazonaws.com
x-amz-expected-bucket-owner: {{ExpectedBucketOwner}}
```

## URI Request Parameters
<a name="API_DeleteBucketWebsite_RequestParameters"></a>

The request uses the following URI parameters.

 ** [Bucket](#API_DeleteBucketWebsite_RequestSyntax) **   <a name="AmazonS3-DeleteBucketWebsite-request-header-Bucket"></a>
The bucket name for which you want to remove the website configuration.   
Required: Yes

 ** [x-amz-expected-bucket-owner](#API_DeleteBucketWebsite_RequestSyntax) **   <a name="AmazonS3-DeleteBucketWebsite-request-header-ExpectedBucketOwner"></a>
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code `403 Forbidden` (access denied).

## Request Body
<a name="API_DeleteBucketWebsite_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_DeleteBucketWebsite_ResponseSyntax"></a>

```
HTTP/1.1 204
```

## Response Elements
<a name="API_DeleteBucketWebsite_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.

## Examples
<a name="API_DeleteBucketWebsite_Examples"></a>

### Sample Request
<a name="API_DeleteBucketWebsite_Example_1"></a>

This request deletes the website configuration on the specified bucket.

```
            DELETE ?website HTTP/1.1
            Host: amzn-s3-demo-bucket.s3.<Region>.amazonaws.com
            Date: Thu, 27 Jan 2011 12:00:00 GMT
            Authorization: signatureValue
```

### Sample Response
<a name="API_DeleteBucketWebsite_Example_2"></a>

This example illustrates one usage of DeleteBucketWebsite.

```
         HTTP/1.1 204 No Content
         x-amz-id-2: aws-s3integ-s3ws-31008.sea31.amazon.com
         x-amz-request-id: AF1DD829D3B49707
         Date: Thu, 03 Feb 2011 22:10:26 GMT
         Server: AmazonS3
```

## See Also
<a name="API_DeleteBucketWebsite_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for C\+\+](https://docs.amazonaws.cn/goto/SdkForCpp/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/s3-2006-03-01/DeleteBucketWebsite) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/s3-2006-03-01/DeleteBucketWebsite) 