Amazon S3 can be used to host static websites, making them accessible via a unique S3-generated URL. This method is ideal for serving HTML, CSS, JavaScript, and images without the need for a web server.
The website URL format depends on the AWS region where the bucket is created. The URL structure may look like:
✅ http://<bucket-name>.s3-website-<region>.amazonaws.com
✅ http://<bucket-name>.s3.<region>.amazonaws.com
The key difference between these formats is the use of a dash (-) vs. a dot (.) in the URL. However, AWS automatically assigns the correct format based on the region, so you don’t need to memorize them.
index.html.index.html).If the website returns a 403 Forbidden error, it means the bucket is not public. To fix this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
}
]
}
🔹 Replace your-bucket-name with your actual S3 bucket name.