amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

Amplify Hosting - Rewrites and redirects - header based redirects

Open georgevicbell opened this issue 1 year ago • 2 comments

Is this feature request related to a new or existing Amplify category?

hosting

Is this related to another service?

Hosting

Describe the feature you'd like to request

Ability to rewrite or redirect based on the headers in the http request.

(currently this is possible with lambda@edge on Cloudfront, but not via amplify hosting)

Describe the solution you'd like

Screenshot 2023-12-18 at 10 49 43 PM

I would like to have two options..."Add URL Rule" and "Add Header Rule"...

URL Rule would behave like the current rule

Header Rule would have the following fields: Header Field (ie User-Agent) Header Values (an array of values, or a regexp that will run the redirect if Header Field is matches) Target Address (where we will redirect to...with wildcards or whatever) Type (200, 30X, 40X) Order

Alternately a way to just redirect to a lambda would be also helpful.

Describe alternatives you've considered

Switching to use Cloudfront seems like a big effort, and loses a bunch of functionality

Additional context

This will allow for handling social media link cards for Facebook/X when using Single Page Apps...lots of other use cases...

Is this something that you'd be interested in working on?

  • [ ] 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • [ ] ⚠️ This feature might incur a breaking change

georgevicbell avatar Dec 19 '23 03:12 georgevicbell

Hey, 👋 thanks for raising this! I'm going to transfer this over to our hosting repository for better assistance 🙂.

ykethan avatar Dec 19 '23 16:12 ykethan

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

github-actions[bot] avatar Dec 19 '23 19:12 github-actions[bot]