Open georgevicbell opened 11 months ago
Hey, 👋 thanks for raising this! I'm going to transfer this over to our hosting repository for better assistance 🙂.
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!
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
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?
Would this feature include a breaking change?