AWS S3 routing rules for appending .html or index.html

Viewed 914

I have a Jekyll generated static HTML page that I use as my homepage. Currently I am trying to migrate it from traditional hosting service on AWS S3. So far I managed to publish all of my files on bucket and enable website hosting, but when it comes to browsing, page is broken.

Basically subpages/ is not rewritten into subpages/index.html and subpages/entry1 is not rewritten into subpages/entry1.html.

Earlier I used .htaccess config like this one:

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(.*subpages/[^.]+)/?$ $1.html
RewriteRule ^(.*subpages2/[^.]+)/?$ $1.html

to rewrite it as intended.

How could such behavior be recreated with S3 routing rules? Documentation presents rather limited set of config options in this regard and does not give examples how such scenario could be achieved.

2 Answers
Related