Skip to content

Instantly share code, notes, and snippets.

@skellertor
Created September 15, 2018 17:20
Show Gist options
  • Save skellertor/b40e50e202808a0dd3803fdd157c7bfc to your computer and use it in GitHub Desktop.
Save skellertor/b40e50e202808a0dd3803fdd157c7bfc to your computer and use it in GitHub Desktop.
s3 static hosting redirect all requests to index.html
Create S3 bucket, for example: react
Create CloudFront distributions with these settings:
Default Root Object: index.html
Origin Domain Name: S3 bucket domain, for example: react.s3.amazonaws.com
Go to Error Pages tab, click on Create Custom Error Response:
HTTP Error Code: 403: Forbidden (404: Not Found, in case of S3 Static Website)
Customize Error Response: Yes
Response Page Path: /index.html
HTTP Response Code: 200: OK
Click on Create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment