www redirect in amplify console infinitely redirects

0

I think I found a bug with AWS Amplify. When I deployed a starter gatsby application and then add a route53 url, I can get the www domain working where it redirects to the root domain. If I go to the root domain directly, however, it redirects infinitely to the www version.

So www.mydomain.com will redirect to mydomain.com and the page loads fine.

Directly going to domain.com will redirect to domain.com/www.domain.com/www.domain.com... and that will repeat forever in the web address.

In the custom domain section I do have a redirect in the root to the www so perhaps that is it, but it is strange that it appends the domain to the url instead of just redirecting.

已提問 5 年前檢視次數 1500 次
3 個答案
0

I had the same problem.
I believe the default values written in the tab "Rewrites and redirects" are not correct.

If you look at the line for the 302 redirect, you will see:

  • source address: https://your_domain.com
  • target address: www.your_domain.com

You need to change the target address to: https://www.your_domain.com

Hope it solves your problem!

Not sure how to report it as a bug to the amplify team.

Edited by: boris13 on Apr 28, 2019 9:16 AM

boris13
已回答 5 年前
0

Hi stephen and boris,

You're right, this is an issue on our end that we are working to fix! In the meantime, the above answer is correct. Add "https://" to the front of the custom domain target in the app rewrites and redirects page.

Please let me know if this still doesn't working for you.

Thanks,
Dan

AWS
已回答 5 年前
0

That totally worked, thanks so much Boris & Dan!

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南