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 ...

已提问 8 个月前206 查看次数
1 回答
0
已接受的回答

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
支持工程师
已回答 8 个月前
profile picture
专家
已审核 2 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则