Unfortunately not…
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 ifwindow.location.pathnamematches/collectionsor/collections/and redirecting accordingly - Comprehensive solution: One user shared code redirecting both
/collectionsand/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.