Open benjaminsehl opened 2 years ago
@davecyen — I thought we'd looked at this already, but maybe we moved on at the time since the redirect API hadn't yet been exposed?
Yeah
Any update on this
@AlexanderBMAS the storefront API added the ability to query redirects by path. The recommended solution at the moment is just to manually make that request on a 404 page. If the redirect exists, forward the user, else serve a 404 page.
There should be an out of the box implementation for implementing the redirects available at
/admin/redirects
in Hydrogen.The router would then ideally work something like this (naming should be workshopped) …
We would leverage the redirect API here: https://shopify.dev/api/storefront/2022-07/objects/UrlRedirect
Caveats would include that this would apply for both Online Store and Hydrogen — which may not be desirable. This needs to be looked at from the admin perspective with the broader team, in addition to the Menus UI.
In an optimal solution, it would be worth considering having this also be implemented at the Oxygen level for lowest latency — but Hydrogen would still need to implement so it could be available in all hosting solutions.