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

DEV-3291 Fix redirections in URLs based on drive #241

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mayra-gataca
Copy link
Contributor

@mayra-gataca mayra-gataca commented Oct 17, 2023

Jira: https://gataca.atlassian.net/jira/software/c/projects/DEV/boards/26?assignee=6405a762c6e77744a1de59d6&selectedIssue=DEV-3291

DONE:

  • Fixed url /use-cases/finance to /use-cases/financial
  • Added redirection
{
    "fromPath": "/blog/",
    "toPath": "/resources/blog/"
 },

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?

{
    "fromPath": "/products/",
    "toPath": "/products/gatacaStudio/"
 },
{
    "fromPath": "/blog/",
    "toPath": "/resources/blog"
  },

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?


{
    "fromPath": "/products/certify/",
    "toPath": "/products/gatacaStudio/"
  },
{
    "fromPath": "/products/connect/",
    "toPath": "/products/gatacaStudio/"
  },
{
    "fromPath": "/developers/",
    "toPath": "/resources/documentation"
  },
{
    "fromPath": "/company/press/",
    "toPath": "/company/about/"
  },

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))
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
Screenshot 2023-10-17 at 17 26 29

These means that redirect is not working with Gatsby, where else are we declaring that 404 should take us to Home?

{
    "fromPath": "/404/",
    "toPath": "/"
  },
{
    "fromPath": "/404.html",
    "toPath": "/"
  }

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.

@jose-gataca
Copy link
Contributor

@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.

@mayra-gataca
Copy link
Contributor Author

@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

Screenshot 2023-10-18 at 09 29 47

Could be something related to the DNS? I need some help with this issue

@jose-gataca
Copy link
Contributor

@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

Screenshot 2023-10-18 at 09 29 47

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.

@mayra-gataca
Copy link
Contributor Author

@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
Screenshot 2023-10-18 at 09 29 47
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

@mayra-gataca
Copy link
Contributor Author

@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
Screenshot 2023-10-18 at 09 29 47
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants