-
Notifications
You must be signed in to change notification settings - Fork 1
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
DEV-3291 Fix redirections in URLs based on drive #241
base: master
Are you sure you want to change the base?
Conversation
@mayra-gataca Is any configuration different between dev and pro? why is it behaving differently? Also: could the 404 redirection - when we find where its configured - just be triggered if no redirection works? Seems trick or confusing to do, but would be ideal. |
@jose-gataca for what it seems there is a different configuration in pro, but this is what I'm having trouble to find, so not sure if this configuration is in the front. If we inspect the Network, the redirect status 307 is the same in dev in pro Could be something related to the DNS? I need some help with this issue |
I don't think it's DNS related. The best option I can think is that it's something on Gatsby's configuration, either that or compiling the nginx image to serve the front. I wouldn't imagine there is any difference there. So maybe just block it for the moment and I'll try to help you out if I'm done with my task. |
Thank you @jose-gataca for the input. @angiebenavente has suggested that we try one approach, which is to use react route instead of gatsby route based on this https://dev.to/uma/gatsby-route-v-s-react-route-21nj, I'm going to adjust the code and make tests in dev https://www.dev.gataca.io/, and will give an update |
@jose-gataca this approach is taking too much time to test because we need to change a lot of code. Talking to Jorge about this, he mentioned as you before that the redirection to the home page could be configured in the nginx, which is related to the infrastructure, so whenever you can give us a hand with this. The main thing is to confirm that we are commanding a redirection of all no existing pages to "/", and if yes, then this is what is overwriting the redirection we have with gatsby in gatsby-node.js |
Jira: https://gataca.atlassian.net/jira/software/c/projects/DEV/boards/26?assignee=6405a762c6e77744a1de59d6&selectedIssue=DEV-3291
DONE:
MISSING: on dev the urls listed on
redirect.json
are redirecting correctly to the new url, but not in pro.Analysis:
Dev: takes to correct url declared in JSON file however it doesn't charge the page because redirects happen on client side (more info gatsbyjs/gatsby#26218 (comment))
Pro: 403 forbidden
We have folders with the same name for new pages, should this be something affecting?
Dev: takes to correct url declared in JSON file however it doesn't charge the page because redirects happen on client side (more info gatsbyjs/gatsby#26218 (comment))
Pro: Home - maybe a 404 error before which redirects to Home? Redirect to Home a 404 error is correct, but why a 404 error?
Dev: error rendering however takes to correct url declared in JSON file however it doesn't charge the page because redirects happen on client side (more info gatsbyjs/gatsby#26218 (comment))
![Screenshot 2023-10-17 at 17 26 29](https://private-user-images.githubusercontent.com/127114451/275888290-eaedcfe0-128b-4583-b318-5701cb9adc32.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjY0OTQsIm5iZiI6MTczOTMyNjE5NCwicGF0aCI6Ii8xMjcxMTQ0NTEvMjc1ODg4MjkwLWVhZWRjZmUwLTEyOGItNDU4My1iMzE4LTU3MDFjYjlhZGMzMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQwMjA5NTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05YWE4MTUyZGMzYWMxMTY5ODI1ZGQxM2MzZTBjMmVjMjhhOTQzYWFhOTBhOWZlNmU4ZTQzMjkxYTQ4ZTRiNThmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.xLcoL2unE4E-QsK386rFqqA6j-moRdenSIm0rqxScTk)
Pro: takes to correct url declared in JSON file however it doesn't charge the page because redirects happen on client side (more info gatsbyjs/gatsby#26218 (comment))
Remember that we have a 404 page created and with Gatsby pages take precedence over redirects
These means that redirect is not working with Gatsby, where else are we declaring that 404 should take us to Home?
Conclusion:
I believe that somehow in the server side (production) we are declaring that 404 status should be redirected to Home and this overwrites redirection with Gatsby, all pages that don't exist are a 404 status. Pages with url name that also exist as name for page folders, give a 403 status.