This seems to work well, but there's one is one huge roadblock: the number of redirects configured using routing rules is apparently limited to 50. If you go over that, the AWS SDK gives this error:
software.amazon.awssdk.services.s3.model.S3Exception: … routing rules provided, the number of routing rules in a website configuration is limited to 50. (Service: S3, Status Code: 400, Request ID: …)
With this approach one must store a zero-byte (or any content, apparently) object with a special x-amz-website-redirect-location metadata value that either indicates the path to another S3 object or a URL. We'll need to update the Guise Mummy S3 website deployment to use this object-based redirect, at least for files.
S3 websites now have a redirectMeans configuration setting, with these options:
- optimal: (default) Functions like object except that if the total number of redirects is below redirectCountOptimalThreshold (which currently defaults to 30 but can be configured), functions like routing-rule.
- object: All redirects use objects, except for redirects from collections, which must use routing rules.
- routing-rule: All redirects use routing rules.