Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React app with React-Router deployed on Amplify Console, redirects to index.html #430

Closed
ilyador opened this issue Feb 12, 2020 · 9 comments
Labels
archived This issue has been locked. question Further information is requested

Comments

@ilyador
Copy link

ilyador commented Feb 12, 2020

Whenever I open the app from the root URL and navigate, all is fine.
However, if I go directly to, or refresh app.com/login or any other non-root URL, I get redirected to the non-existent index.html.

I have tried the solutions from this issue, but nothing seems to work aws-amplify/amplify-js#2498

I did not configure any other routing or URL related things in my app (there is a comment about Vue saying there is sime configuration to be done before deployment, I haven't found anything similar about react and react-create-app scaffolding).

@kaustavghosh06 kaustavghosh06 transferred this issue from aws-amplify/amplify-cli Feb 12, 2020
@ihao8
Copy link
Contributor

ihao8 commented Feb 12, 2020

Hi @ilyador , did you try

source: </^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)([^.]+$)/>
target: /index.html
type: 200 

or change source to:
</^((?!\.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$).)*$/>

@ilyador
Copy link
Author

ilyador commented Feb 12, 2020

@Joycehao19 Yes, this is what I did. No luck.
72205123-0cb17180-34b2-11ea-899f-5744d5bc79b0

Tried
</^((?!\.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$).)*$/> and
</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)([^.]+$)/>

@ihao8 ihao8 added the question Further information is requested label Feb 12, 2020
@ihao8
Copy link
Contributor

ihao8 commented Feb 13, 2020

@ilyador Did you have a sample app we could test? Did you set anything we need to pay attention?

@ilyador
Copy link
Author

ilyador commented Feb 14, 2020

@Joycehao19 This is weird: I have one app that works fine, and another that doesn't with the same stack (react + react-router) and same settings.
This is the one that doesn't: https://www.photowin.net/

@ilyador
Copy link
Author

ilyador commented Feb 21, 2020

@Joycehao19 I think I know what went wrong: for some reason, my domain is no longer managed by the Amplify console.
When I go to the URL I still get to the app, but It does not appear in the domain management section. When I try to connect it again I get an error that it is already in use.

@ihao8
Copy link
Contributor

ihao8 commented Feb 26, 2020

#454
Resolved issue. Closing for now.

@ihao8 ihao8 closed this as completed Feb 26, 2020
@Apoorva-lokhande
Copy link

#454
Resolved issue. Closing for now.

how did you resolve?
same issues

@bksun
Copy link

bksun commented Aug 3, 2020

#454
Resolved issue. Closing for now.

how did you resolve?
same issues

Even I have very same issue, trying to connect to amplify public url but not working as expected.

When routes match then a blank page is rendered(which is not expected but when route doesn't match then I get error page as expected.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the archived This issue has been locked. label Oct 29, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants