Q:

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

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.

A:

Amazon S3 does not have extensive re-writing capabilities.
You can specify a default document to read when a directory reference is specified. For example, you can specify that the default document is index.html. That way, if / is requested, then it will serve up /index.html. But this is a per-bucket setting, so you cannot have different rules for different folders.
You could modify your Jekyll configuration to generate subpages/entry1/index.html from subpages/entry1.html. This way, your URLs will continue to work.

A:

You need to fix the reference to have subpages/entry1.html at the first place. Than you do not need a rewrite.

