Skip to content

Commit 02a535b

Browse files
author
Aaron Chambers
committed
Merge pull request #50 from jarredkenny/patch-1
Update README to include Cloudfont pretty url config
2 parents 9a56924 + 51da6fa commit 02a535b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,25 @@ The following is an example policy that meets these requirements:
226226

227227

228228
## Using History-Location
229-
You can deploy your Ember application to S3 and still use the history-api for pretty URLs. This needs some configuration tweaking in your bucket's static-website-hosting options in the AWS console though. You can use S3's `Redirection Rules`-feature to redirect user's to the correct route based on the URL they are requesting from your app:
229+
You can deploy your Ember application to S3 and still use the history-api for pretty URLs. This needs some configuration and the exact process depends on whether or not you are using Cloudfront to serve cached content from your S3 bucket or if you are serving from an S3 bucket directly using S3's Static Website Hosting option. Both options work, however, the Cloudfront method allows the process to occur without flashing a non-pretty URL in the browser before the application loads.
230+
231+
### With Cloudfront
232+
A Cloudfront Custom Error Response can handle catching the 404 error that occurs when a request is made to a pretty URL and can allow that request to be handled by index.html and in turn Ember.
233+
234+
A Custom Error Response can be created for your CloudFront distrubution in the AWS console by navigating to:
235+
236+
Cloudfront > `Distribution ID` > Error Pages > Create Custom Error Response.
237+
238+
You will want to use the following values.
239+
240+
* HTTP Error Code: `404: Not Found`
241+
* Customized Error Response: `Yes`
242+
* Response Page Path: `/index.html`
243+
* HTTP Response Code: `200: OK`
244+
245+
### Without Cloudfront
246+
247+
From within the Static Website Hosting options for your S3 bucket, you can use S3's `Redirection Rules`-feature to redirect user's to the correct route based on the URL they are requesting from your app:
230248

231249
```
232250
<RoutingRules>

0 commit comments

Comments
 (0)