-
-
Notifications
You must be signed in to change notification settings - Fork 695
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
Server-side redirects for plone.app.redirector aliases #4854
Conversation
…'d pages and support for other 3XX responses
✅ Deploy Preview for volto canceled.
|
Hi @mamico I've incorporated your changes from #4821 into this PR and fixed some of the issues mentioned by @davisagli as well as resolved some other issues I had with client-side and SSR'd content while trialing your PR. I don't think either PR makes sense without the other really which is why I've merged them into 1. |
@JeffersonBledsoe This is the new one you opened today. Did you mean to close it? |
@davisagli Not sure what happened there, I didn't close it. I had a GitHub bug where i ended up with two branches of the same name which is why i created a second copy of this PR. Mind reviewing this one? |
This comment was marked as outdated.
This comment was marked as outdated.
Passing run #6945 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
@JeffersonBledsoe @djay @davisagli there are any news on this? thx. |
@mamico We’ve been running this in production for a while now, and while it’s mostly been okay, we’ve noticed some weird URLs appearing. I need to verify that this PR isn’t the cause before I’d feel comfortable merging it |
@JeffersonBledsoe @djay @davisagli @sneridagh are there any updates on this? thx |
@mamico what we are seeing is that google search console is ending up indexing urls like (where there was an old url of https://digitalnsw.pretagov.com.au/demo-pages/cards) it might not be change to blame though. We just haven't had the time yet to investigate where these are coming from. |
* fix: backport plone/volto#5069 * fix: backport plone/volto#4854
* fix: backport plone/volto#5069 * fix: backport plone/volto#4854 * strip query string
❌ Deploy Preview for volto failed. Why did it fail? →
|
✅ Deploy Preview for plone-components canceled.
|
7322e19
to
8fdab9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sneridagh I think this is ready now. The fix is basically the same as Rob's from #5999 but it strips /++api++ from the redirect location if it is there.
Thanks for finishing this! |
Co-authored-by: Mauro Amico <[email protected]> Co-authored-by: David Glick <[email protected]>
Co-authored-by: Jefferson Bledsoe <[email protected]> Co-authored-by: Mauro Amico <[email protected]> Co-authored-by: Steve Piercy <[email protected]>
Solves the Volto part of #4800. We're stripping the ++api++ if it is in a location change as we probably don't want to ever navigate directly to a page with ++api++ in it in the browser. Change the action causes the redux store to be correct, but the URL updating occurs earlier in the react-router stack, and so we also manually update the URL to not have ++api++ in it. History is still preserved correctly (++api++ pages aren't in the history stack but we can still go back and forwards normally).
The logic is currently mixed in with the blacklistRoutes middleware while I get some feedback, but this logic should probably be its own middleware for readability.
Note that the
<Redirect>
atvolto/src/components/theme/View/View.jsx
Line 217 in 87ff1f5
<StaticRouter>
should resolve this and can be done in a follow-on PR.