S3 content redirects for multiple files

0

I am aware of how to redirect s3 bucket items using the metadata, but this works only for files that exist. Our developers archived and deleted over 500 files as a routine process and asked to have them redirected.

I have been looking for various solutions on how to resolve the dilemma of applying a redirect to the now missing content to another URL. I have read how to use advanced conditional redirects but it indicates that there's a limit of 50 items maximum that can be applied to the s3 bucket properties on the static web hosting. I'm trying to understand if that's 50 specific rules or 50 items objects that can have multiple redirects using a conditional. Would one behavior with 550+ removed items redirecting elsewhere (new url) count as one object, I've read elsewhere this doesn't work well. and is there any notable performance or impact in approaching it in this method?

I know its possible to create redirects in cloudfront by adding a behavior and developing a script to negotiate all the redirects similar to the above-mentioned approach.

1回答
0

If you're already using CloudFront, you can use Lambda@Edge, which lets you run Lambda functions to customize content AWS delivers through CloudFront. You can store the origin and destination URL in a simple map and use simple match and replace functions to process redirects at the edge locations.

Remember that the Lambda@Edge needs to be deployed in us-east-1 and will record logs in the region from which the user accessed it.

Here are some links that are a good reference for what you're trying to build:

If the answer is helpful, please click "Accept Answer" and upvote it.

profile picture
エキスパート
回答済み 1年前
profile picture
エキスパート
レビュー済み 7ヶ月前
  • Perhaps thats something the developers should have presented to you as the solution as they should be aware of the setup

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ