Re: naviRe: Is it possible to redirect /collections/ to /collection/all ?

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

Shopify Partner
11 0 5



Just wondering if it is possible to do this...

There aren't many products on the site I'm working on, so within the main navigation the 'STORE' links to /collections/all. 

The problem is that if someone visits - it takes them to an overview of all of the collections which I don't want. 

Is there a way to bypass this with redirects? 



Replies 13 (13)

Shopify Staff
2396 255 526

Hey, @cwilson 

If you want your 'STORE' to link to all of the products available on your store as opposed to all of the collections on your store, you can make this change within your navigation settings.

By going to online store > navigation > click on the menu you want to edit > click the edit button beside menu item you want to edit >change the link to 'All Products'. As shown below:



Once you do that, be sure to save your changes. If there is anything else I can help you with, please let me know.

Dirk | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Shopify Partner
11 0 5

Hi Dirk,


Thanks, but that isn't quite what I was looking for. Even though the navigation bar links to 'All Products' if a visitor was to navigate to they would still see a page that I don't want them to see.

I have no need for the page, so, therefore, do not want to spend time having to style it when it is redundant. 

Is there a way that I can redirect all traffic that tries to reach /collections/ ? 



4 0 3

Did you ever get an answer to this?  Im not sure why all the Shopify members think a solution is to hide the links....people can still access the can still index them......

Shopify Partner
11 0 5

Unfortunately not... 

Shopify Partner
20 4 3

Hi, a bit late to the party 😀

I had the same request from a client. The Shopify redirects don't seem to work with some key pages, like the /collections one.


I made it work by adding a JavaScript redirect in the list-collections.liquid template file in my theme:

  location.href = '/collections/all';


Hope this helps.

Shopify Partner
1 0 0

Alex, where exactly would you add the script?

I tried adding at the end or before {% endschema %} of my collection-list.liquid or to list-collections.json - doesn't work, it won't redirect.


Shopify Partner
16 0 4

Add the following script in the theme.liquid file before </body>

let url = window.location.href;
if (url.includes('/collections/collection-name')) {
location.href = '/products/productname';

Shopify Partner
2967 571 901

Yes, the following instructions will work for any theme.

1. In your Shopify Admin go to online store > themes > actions > edit code
2. In your theme.liquid file, find the </body> (press CTRL + F or command + F on Mac)
3. paste this code right above the </body> tag:


if (/collections$/.test(window.location.href)){
var url = `${window.location.href}/all` 
window.location.href = url;


Whenever the user lands on a URL ending specifically with "collections" they will be redirected to "collections/all".

Kind regards,

3 0 0

Hi Diego, this solution definitely helps when someone lands on <store>/collections. However, it does not help when someone adds the '/' at the end, e.g., <store>/collections/

17 2 4

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 but not


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.

Shopify Partner
4 0 3

Do something like following in your theme.liquid by adding a <script></script> block containing following,



// redirect '/collections' or '/collections/' or '/products' or '/products/' to '/pages/our-product-range'
// Shopify navigation redirects won't work for these urls as they are Shopify default urls not controlled by the theme
if (window.location.pathname === '/collections' || window.location.pathname === '/collections/' || window.location.pathname === '/products' || window.location.pathname === '/products/') {
window.location.href = '/pages/our-product-range';


In terms of SEO, before anyone asks, 

5 0 8

I tried this and it worked for me.


First, create a new collection and name it "all". Add any or all of the products you want to show.


Second, add this code to your theme.liquid file, right after the <head> tag:

{% if request.path == '/collections' %}
{% endif %}



That's it. Now when someone goes to, they will see

3 0 1

This code solved everything for me:

if (/collections\/?$/.test(window.location.href)){
  var url = window.location.href.replace(/\/?$/, '') + '/all';
  window.location.href = url;
} else if (/products\/?$/.test(window.location.href)){
  window.location.href = window.location.origin + '/collections/all';

It redirects /products, /products/, /collections, and /collections/ to /collections/all