-
Notifications
You must be signed in to change notification settings - Fork 398
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
Refreshing a route while logged in redirects to index.html #27
Comments
I've got a similar problem although with a slight difference:
I followed this documentation: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#redirects-for-single-page-web-apps-spa Were you able to handle this issue @CaptainChemist ? |
@devnantes44 No, I wasn't able to solve it unfortunately. |
@devnantes44 @CaptainChemist have you both had a chance to go through the above link and if so, is the issue still happening? |
@mtliendo I just tried having the following be my only redirect and I can confirm that this did not fix my problem and in fact made it worse. So that documentation provided did not work in my case unfortunately. source address: </^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/> Previously, I could directly navigate to pages that was not a protected route and I would not be navigated to the home page, it was only protected pages that would get navigated back to the home page regardless of whether the person was logged in or not. I think for me personally, even though the expected behavior should be that I can see pages that I should be able to see even if I refresh the page without a redirect to the home page, as long as my public pages act like they should, I can work around that. source address: /<*> |
I'm running into an issue with redirects when I deploy this app. The issue is that when I am logged in and reload the page, I get redirected to index.html which then redirects me to the home page. The expected behavior is that reloading the page should maintain the current route.
Steps to reproduce:
I made a video which documents this behavior:
https://www.youtube.com/watch?v=3rhpsWgAX3s
I played around with this and the behavior can be "fixed" by changing the 404 redirect to a 404 rewrite, but it has the negative consequence that none of the meta tags load and it shows up to facebook link debugger as a 404 error (in contrast to the default behavior where it all loads correctly). So that's to say that the 404 rewrite change probably isn't a long term solution.
Any ideas how you'd go about fixing this? Thanks so much for contributing this demo repo Nader, it's really great!
The text was updated successfully, but these errors were encountered: