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

Problems with routes and 404 page on Gatsby site in AWS Amplify #886

Closed
anatolzak opened this issue Jul 23, 2020 · 7 comments
Closed

Problems with routes and 404 page on Gatsby site in AWS Amplify #886

anatolzak opened this issue Jul 23, 2020 · 7 comments
Labels
archived This issue has been locked.

Comments

@anatolzak
Copy link

I have created a multi-page site with gatsby.js deployed on Amplify.

When I go to any page other than index.html, it shows me my 404.html and then after a few seconds, it shows the actual page I should see for that route.

Obviously there is something wrong with that. I deployed the same site with Netlify and that doesn't happen there.

Here are my Rewrites and redirects:

image

@anatolzak anatolzak changed the title Problems with 404 page on Gatsby site in AWS Amplify Problems with routes and 404 page on Gatsby site in AWS Amplify Jul 23, 2020
@ohlr
Copy link

ohlr commented Jul 27, 2020

</index\.html/> -> /404.html

@anatolzak
Copy link
Author

@ohlr that worked by it doesn't keep query params.

@ohlr
Copy link

ohlr commented Jul 27, 2020

there is a whole discussion here #70..

@fpsoriano
Copy link

I have the same problem.

https://www.apresentar.me/fabricio => does not work
https://www.apresentar.me/fabricio/ => works.

Did you find a solution?

@anatolzak
Copy link
Author

@fpsoriano I haven’t yet found a solution. I have been using Netlify instead because everything works perfectly with them.

I wish deploying to amplify didn’t include having to figure out weird bugs that simply aren’t supposed to be part of the platform :(

@cslogan-red
Copy link

As noted by @ohlr the solution in #70 is currently the accepted solution for 404 rewrite behavior. As far as query string params, the target address currently only supports path based params used by most router frameworks, not the transposition of a query string, IE, the below is valid:

Source is: /docs?id=<resourceId>&hat=<hat>
Target is: /documents/<resourceId>/<hat>

But the following is not currently directly supported ( see #97 )

Source is: /docs?id=<resourceId>&hat=<hat>
Target is: /documents?id=<resourceId>&hat=<hat>

That said, as others have mentioned in #97 , you can use a trailing slash with a wildcard (the trailing slash is required) in the source to redirect everything (including anything you want preserved in the query string) from one path to another:

Source is: /docs/<*>
Target is: https://myurl.com/<*>

Closing this as a duplicate of #70 and #97, please follow those issues for updates and let us know if you have any further questions in either of those issues, thanks!

@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.
Projects
None yet
Development

No branches or pull requests

4 participants