AWS Amplify: How to redirect multiple domains to different destinations?

0

In Amplify it's easy to configure a number of domains, get SSL zerts assigned and get the requests in. Instead of letting an application redirect, I want to directly use the redirect feature. So if I can reach the app with https://domain-a.com and https://domain-b.com, configure redirects with
[ { "source": "https://domain-a.com/<*>", "target": "https://domain-d.com/path-x/<*>", "status": "302", "condition": null }, { "source": "https://domain-b.com/<*>", "target": "https://domain-e.com/path-y/<*>", "status": "302", "condition": null } ] and call https://domain-b.com/asdf.html the result will allways be a use of the first redirect setting and ignoring the domain completely. Even without <*> it will behave the same and ignore the domain. Tried a number of combinations, with and without pathes, ...

Any idea? Not useful to do so? The documentation in https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#simple-redirects-and-rewrites seems to allow domain redirects ...

asked 8 months ago196 views
1 Answer
0
Accepted Answer

Hello,

Thank you for reaching out to us.

Amplify currently does not support the use of the domain + path in the source address of the redirect rule. We can either use the domain or the specific path as the source rule. You may refer below GitHub that is raised as Feature Request for the same.

https://github.com/aws-amplify/amplify-hosting/issues/97#issuecomment-528567207

Hence, I would suggest you to track the above existing open GitHub Issue in order to actively track the update on the feature request.

AWS
SUPPORT ENGINEER
answered 8 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions