Redirect home page to collection page - Dawn theme

Hi all,

I’d like to re direct my homepage to the collections page. I cant seem to do this from navigation and url redirects. Essentially what i want is when you go to https://shop.prettylittlepeaches.com/ i want it redirected to https://shop.prettylittlepeaches.com/collections/all

Is there any code i can put in the edit code to do this? Im using dawn theme. Thanks in advance.

Hi @mostafamoussa
Please add this code before tag.

{% if template == index %}

{% endif %}
1 Like

This did not seem to work, can you be more specific on placement? the collections page url is https://shop.prettylittlepeaches.com/collections/all

I edited the code and this seems to work. I added this to top of head tag

{% if template == ‘index’ %}

{% endif %}

5 Likes

can you please share your theme.liquid file code?

Works for me, however it breaks editing the original “Home Page” shopify becomes stuck in infinite loop, however if you simply change away from that page it’s works fine.

works for me thanks a lot :grinning_face:

I’m trying to accomplish the same thing on my website. Redirect from my homepage (dawn theme) to another page on my website.

Hi, this solution does not work for me! I pasted the code under the head tag inside the theme.liquid file but the redirect does not work. Can someone help?

I know this is old but incase anyone faces this issue, make sure to include single quotes around the index, as below:

{% if template == ‘index’ %}

3 Likes

need to include single quotes around index as so: {% if template == ‘index’ %}

2 Likes

You’re a Godsend

It goes ABOVE, the head tag, not under.

(And don’t forget to put the single quotes around index )

e.g.

{% if template == ‘index’ %}

{% endif %}

Is there a way to do this do it is a 301 redirect? Google doesn’t follow these types of redirects and this caused my home page to still get indexed and the page it redirects to get deindexed.

More on this here