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

preguntada hace 8 meses204 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
INGENIERO DE SOPORTE
respondido hace 8 meses
profile picture
EXPERTO
revisado hace 2 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas