Is it possible to redirect /collections/ to /collection/all ?

Topic summary

The original poster wants to redirect /collections to /collections/all because they don’t want visitors accessing the collections overview page, which they consider redundant and don’t want to style.

Initial Misunderstanding:
Early responses suggested changing navigation links, but this doesn’t prevent direct URL access or search engine indexing of the unwanted page.

Working Solutions:
Several JavaScript-based redirects were proposed and confirmed working:

  • Basic redirect: Add JavaScript to theme.liquid (before </body>) checking if window.location.pathname matches /collections or /collections/ and redirecting accordingly
  • Comprehensive solution: One user shared code redirecting both /collections and /products (with/without trailing slashes) to desired destinations
  • Alternative approach: Create a custom collection named “all” which overwrites Shopify’s default, eliminating the need for code in some themes

Key Limitation:
Shopify’s built-in redirect feature doesn’t work for default pages like /collections, requiring JavaScript workarounds.

SEO Note:
While JavaScript redirects aren’t true 301s, Google Search respects them as permanent redirects, though indexing updates may take several days.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Hey @diego_ezfy , thank you for this. Do you have a solution for what happens when the client puts a / on the end? Your solution works for ABC.com/collections but not ABC.com/collections/

Thank you. Each of our collections represent products that are exclusive for a certain customer. We don’t want people to get in a situation where they can see all of our collections. That would be bad.