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

Invalid or vanity URL's with a single path segment do not redirect to 404 or to a redirect set in Shopify #2270

Closed
jeremyagabriel opened this issue Jun 21, 2024 · 2 comments

Comments

@jeremyagabriel
Copy link

jeremyagabriel commented Jun 21, 2024

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2024.4.2

What version of Remix are you using?

2.9.2

Steps to Reproduce

  1. Observe how this invalid url - https://hydrogen.packdigital.com/xyz - with only one path segment, does not redirect to 404, instead the home page
  2. Observe how this invalid url - https://hydrogen.packdigital.com/xyz/123 - with at least 2 path segments, does redirect to 404 correctly
  3. Observe how this vanity url - https://hydrogen.packdigital.com/about - with only one path segment, does not redirect to "/pages/about-us" as set in URL redirects within the Online Store Shopify app
  4. Observe how this vanity url - https://hydrogen.packdigital.com/pages/1 - with at least 2 path segments, does redirect to "/pages/privacy" as set in URL redirects within the Online Store Shopify app

Expected Behavior

  • The catch all route $.tsx placed in /routes should catch invalid url's with only one path segment, e.g. /xyz and redirect to the 404 page
  • Redirect from url's with only one path segment, e.g. /about should redirect to the url set in URL redirects in Shopify, e.g. /pages/about-us
export async function loader() {
  throw new Response(null, {status: 404});
}

export default function Route404() {
  return null;
}

Actual Behavior

All invalid or vanity url's with only one path segment redirect to the home page no matter what. For invalid url's, the loader from $.tsx is never reached, thus no redirect to the 404 page.

@jeremyagabriel jeremyagabriel changed the title Invalid URL's with a single path segment do not redirect to 404 or to a redirect set in Shopify, rather to the home page Invalid or vanity URL's with a single path segment do not redirect to 404 or to a redirect set in Shopify Jun 21, 2024
@joniler
Copy link

joniler commented Jun 21, 2024

Seeing this same thing with umzu.com

@jeremyagabriel
Copy link
Author

jeremyagabriel commented Jun 21, 2024

No longer believed to stem from Hydrogen, please disregard.

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

No branches or pull requests

2 participants