When you configure your bucket as a static website, the website is available at the AWS Region-specific website endpoint of the bucket. Website endpoints are different from the endpoints where you send REST API requests. For more information about the differences between the endpoints, see Key differences between a website endpoint and a REST API endpoint.
Depending on your Region, your Amazon S3 website endpoint follows one of these two formats.
s3-website dash (-) Region â http://
bucket-name
.s3-website-Region
.amazonaws.com
s3-website dot (.) Region â http://
bucket-name
.s3-website.Region
.amazonaws.com
These URLs return the default index document that you configure for the website. For a complete list of Amazon S3 website endpoints, see Amazon S3 Website Endpoints.
NoteTo augment the security of your Amazon S3 static websites, the Amazon S3 website endpoint domains (for example, s3-website-us-east-1.amazonaws.com or s3-website.ap-south-1.amazonaws.com) are registered in the Public Suffix List (PSL). For further security, we recommend that you use cookies with a __Host-
prefix if you ever need to set sensitive cookies in the domain name for your Amazon S3 static websites. This practice will help to defend your domain against cross-site request forgery attempts (CSRF). For more information see the Set-Cookie page in the Mozilla Developer Network.
If you want your website to be public, you must make all your content publicly readable for your customers to be able to access it at the website endpoint. For more information, see Setting permissions for website access.
Website endpoint examplesThe following examples show how you can access an Amazon S3 bucket that is configured as a static website.
Example â Requesting an object at the root levelTo request a specific object that is stored at the root level in the bucket, use the following URL structure.
http://bucket-name
.s3-website.Region
.amazonaws.com/object-name
For example, the following URL requests the photo.jpg
object that is stored at the root level in the bucket.
http://example-bucket.s3-website.us-west-2.amazonaws.com/photo.jpg
Example â Requesting an object in a prefix
To request an object that is stored in a folder in your bucket, use this URL structure.
http://bucket-name
.s3-website.Region
.amazonaws.com/folder-name
/object-name
The following URL requests the docs/doc1.html
object in your bucket.
http://example-bucket.s3-website.us-west-2.amazonaws.com/docs/doc1.html
Adding a DNS CNAME
If you have a registered domain, you can add a DNS CNAME entry to point to the Amazon S3 website endpoint. For example, if you registered the domain www.example-bucket.com
, you could create a bucket www.example-bucket.com
, and add a DNS CNAME record that points to www.example-bucket.com.s3-website.
. All requests to Region
.amazonaws.comhttp://www.example-bucket.com
are routed to www.example-bucket.com.s3-website.
.Region
.amazonaws.com
For more information, see Customizing Amazon S3 URLs with CNAME records.
Using a custom domain with Route 53Instead of accessing the website using an Amazon S3 website endpoint, you can use your own domain registered with Amazon Route 53 to serve your contentâfor example, example.com
. You can use Amazon S3 with Route 53 to host a website at the root domain. For example, if you have the root domain example.com
and you host your website on Amazon S3, your website visitors can access the site from their browser by entering either http://www.example.com
or http://example.com
.
For an example walkthrough, see Tutorial: Configuring a static website using a custom domain registered with Route 53.
Key differences between a website endpoint and a REST API endpointAn Amazon S3 website endpoint is optimized for access from a web browser. The following table summarizes the key differences between a REST API endpoint and a website endpoint.
Key difference REST API endpoint Website endpoint Access controlSupports both public and private content
Supports only publicly readable content Error message handlingReturns an XML-formatted error response
Returns an HTML document Redirection supportNot applicable
Supports both object-level and bucket-level redirects Requests supportedSupports all bucket and object operations
Supports onlyGET
and HEAD
requests on objects Responses to GET
and HEAD
requests at the root of a bucket Returns a list of the object keys in the bucket Returns the index document that is specified in the website configuration Secure Sockets Layer (SSL) support Supports SSL connections Does not support SSL connections
For a complete list of Amazon S3 endpoints, see Amazon S3 endpoints and quotas in the AWS General Reference.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4