Create an Amazon S3 replacement for .htaccess files

Description

Amazon S3 does not support the use of .htaccess files for redirection in the case of unfound resource requests. We use them to redirect to an appropriate version specific 404 page for each release, such as

http://docs.cask.co/cdap/current/en/404.html

However, only one such page is permitted for the entire S3 bucket. So, we need a page that, on load, figures out which directory the request came from, and then redirects to the appropriate page.

If the directory requested falls under this:

http://docs.cask.co/<product>/<version>/...

then redirect to

http://docs.cask.co/<product>/<version>/en/404.html

If the directory requested falls under this:

http://docs.cask.co/<product>/...

then redirect to

http://docs.cask.co/<product>/404.html

If the directory requested is above that, and under this,

http://docs.cask.co/...

then redirect to

http://docs.cask.co/404.html

Release Notes

None

Activity

Show:
John Jackson
November 10, 2016, 3:29 AM
Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

John Jackson

Reporter

John Jackson