Linux command
aws-s3-website 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Configure a bucket
aws s3 website s3://[bucket-name]/ --index-document [index.html] --error-document [error.html]
Set only the index document
aws s3 website s3://[bucket-name]/ --index-document [index.html]
说明
aws s3 website configures an S3 bucket to host a static website. Once configured, the bucket contents are accessible via an S3 website endpoint URL. The index document is returned when visitors request the website root or any directory path. The error document is displayed when a 4XX error occurs (such as 404 Not Found).
参数
- S3Uri
- The S3 bucket URI to configure (s3://bucket-name/)
- --index-document _value_
- Suffix appended to directory requests (e.g., index.html); cannot be empty or contain slashes
- --error-document _value_
- Object key name to display when a 4XX class error occurs
FAQ
What is the aws-s3-website command used for?
aws s3 website configures an S3 bucket to host a static website. Once configured, the bucket contents are accessible via an S3 website endpoint URL. The index document is returned when visitors request the website root or any directory path. The error document is displayed when a 4XX error occurs (such as 404 Not Found).
How do I run a basic aws-s3-website example?
Run `aws s3 website s3://[bucket-name]/ --index-document [index.html] --error-document [error.html]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does S3Uri do in aws-s3-website?
The S3 bucket URI to configure (s3://bucket-name/)