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

posta 8 mesi fa206 visualizzazioni
1 Risposta
0
Risposta accettata

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
TECNICO DI SUPPORTO
con risposta 8 mesi fa
profile picture
ESPERTO
verificato 2 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande