assembler
assembler

Reputation: 3300

Deployed Reactjs in AWS Amplify is removing the URL parameters the first time it loads

I have a very simple ReactJS app deployed using AWS Amplify and it is removing the whole parameters section from the given URL the first time it loads. This is not happening on my local environment. I simulated a production environment on my local and it works fine.

For example, if I enter this URL: https://deployed_url?param1=one&param2=two the first time it becomes https://deployed_url the first time. After that https://deployed_url?param1=one&param2=two keeps these parameters.

I've been googleing for a possible solution, but I was unable to find any clue on how to solve this. Any idea?

Upvotes: 0

Views: 698

Answers (1)

LuckyTuvshee
LuckyTuvshee

Reputation: 1194

Recently I've gotten into this problem. Currently, Amplify doesn't support URL params. The solution is to put a trailing slash before the parameter.

For example: https://example.com/test/?id=123 instead of https://example.com/test?id=123

https://github.com/aws-amplify/amplify-console/issues/97#issuecomment-663103815

from here, you can copy Redirects for SPA.

https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html

Upvotes: 1

Related Questions