I’m trying to make a one product store and changed my homepage in navigation to go to my product page, however, when I search my website or click this here. It goes to the home page that’s incomplete. I don’t want it to go there and when I try to change the settings it doesn’t give me the option. Can you help me? What do I do? Is there a redirect in the code or something because I’m pretty annoyed how I can’t change it.
Topic summary
Goal: make a one‑product Shopify store send visitors to the product page instead of an incomplete homepage (logo click and search currently land on the homepage).
Guidance offered:
- Prefer using a “featured product” section on the homepage to mimic the product page, especially if the domain matches the product name. This avoids messy URLs and improves UX.
- If a redirect is required, edit theme.liquid and insert code immediately after the opening to set a product_handle and redirect via JavaScript: window.location.href = {{ product.url }}. Use the product’s handle (e.g., “frozen-berries-2”) and ensure clean, succinct URLs.
Implementation notes:
- Product handle = the unique, URL‑friendly identifier for a product.
- theme.liquid = the main theme layout; custom‑liquid sections render visible content and aren’t suitable for head‑level redirects.
- The code should not output visible elements; it only sets up a redirect.
Recent developments:
- Inserting the code in a Custom Liquid section caused a product reviews widget to appear (likely due to placement).
- After moving code to theme.liquid, saving produced an error (details unclear). Screenshots show code placement and the save error.
Status: unresolved. Next steps are to place the redirect code strictly after in theme.liquid, verify the product handle and URL, and address the save error (possible theme conflict).
I did the but when I click on the logo on the top it takes me to the incomplete homepage
Hi @Auraeves
is a redirect the actual problem: xyproblem.info ,
you may instead want to use a featured product section for the homepage in a theme that has one that works like the product detail page.
Doubly so if your domain name is already named after the product otherwise it just looks sloppy to have amazingproduct.coms/amazing-product
As it’s then also a bit easier and saner to redirect amazingproduct.coms/amazing-product to the homepage / , such as if for some reason someone lands on an internal search page or collection.
If you must insist on redirecting away from the homepage either add a custom-liquid section to the homepage, or backup theme and edit the theme.liquid directly to insert the following code to be right after the opening tag:
{%- if template == index -%}
{%- assign product_handle = "INSERT-PRODUCT-HANDLE-HERE" -%}
{%- assign product = all_product[product_handle] -%}
{% endif %}
This uses the products relative url , you may need to use the full shop name before it or routes to accomdate things like international domains.
{{ shop.url }}/{{ product.url }}
https://shopify.dev/docs/api/liquid/objects/product#product-url
I just did it and the product reviews widget just popped up. Say “Google.con/Frozen-Berries-2” is the url, for the product handle do I put “Frozen-Berries-2”. Can you do an example with this url so I can see how to use the code?
you should edit the product urls to be correct and succint otherwise it’s sloppy and stuff like that costs sales; unless that “2” in the product-handle means something to the product name, or you actually have 2 products.
Put the handle where it says to insert the handle
{%- if template == index -%} {%- assign product_handle = “frozen-berries-2” -%} {%- assign product = all_product[product_handle] -%} {% endif %}
If you need this customization implemented for you then contact me by my email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Good Luck.
backup theme and edit the theme.liquid directly to insert the following code to be right after the opening tag
No, that should just be the section AFTER the custom liquid section.
This code doesn’t output anything visible in a custom liquid section unless you make it do so or there’s a problem with the theme.


