By using AWS re:Post, you agree to the Terms of Use

Amplify: redirect based on environment


Hello, I'm discovering AWS Amplify and I'm surprised that it is not possible yet to write redirects based on the environment.

For example, I'd like that the path /authors - on in dev env, and in production env - redirects with a 301 to in dev env, and in production.

That way I'd end up with the following redirect in dev:

    "source": "/authors",
    "target": "",
    "status": "301",
    "condition": null

How to manage the prod redirect without having to duplicate the whole project?

1 Answer


Thank you for reaching out to us.

Amplify currently doesn't support environment-based redirects. For reverse-proxy redirect, it only support source addresses of paths.

Only Options are to create a new Amplify app for the environment or create your own CloudFront distribution pointing to each of the Amplify CloudFront distributions that handles the redirect for them. Please refer to this link [1] for more information


answered 7 months 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