I have one product store. The product is available on the homepage. Sales funnel targeted to home page, so I direct all traffic to my home page.
However Google has indexed both my home page and my custom product page URL and now they are both in the top of the list.
I need all traffic to the homt page and I made a redirect for the custom product page URL through the Admin Panel-Online Store - Navigation - URL Redirects and specified / as a new URL that visitors should be forwarded to.
Nothing has changed. Redirect does not happen.
Ok. I have explicitly specified the full home page URL as the new URL that visitors should be forwarded to.
JHKC surely you remember that we speak about “one product store” and the whole product page is on the home page. Wouldn’t the solution you’re offering hurt?
Your issue is that you don’t want people to land on your custom product page URL correct? That custom product page is the one under /products/product-handle right?
The code I’ve shared will redirect all users to the homepage when they land on the link above. Let me know if I’m missing something here.
Hello, I know this thread is old but I have a similar issue. My issue is that I need the home page: store.com to redirect to: store.com/products/product-name. Is this possible with that bit of code you supplied but in a different section? I can not seem to find anywhere where it’s possible to redirect the home page to a product page. Main reason for this is my store is a one product store that requires special plugins to display options correctly, but the plug-in only works on the main product page, not the home page. Thanks in advance.
To redirect the homepage to the product page, open your “theme.liquid” file and add the following code at the very top:
{% if template.name == "index" %}
{% endif %}
This will redirect all user traffic from the homepage to the product page directly without triggering any of the third party scripts under since it’s at the very top of the file. Now, this isn’t the “cleanest” way of doing this, it’s more of a quick and dirty approach.
The proper way would be to recreate the product page on the homepage itself directly and thus avoid any redirections across the board.
thank you, you’re amazing! I was able to change the text between the "quotations " so it would redirect immediately to one of my pages on my shopify site. Thank you so much
If people visit Domain1.com the see the main homepage as normal.
But if someone types in Domain2.com in their browser, the javascript detects that the visitor used Domain2.com to reach the shop and so it automatically redirect them to another URL of my choice.
Is this doable?
Next level question:
Is art doable ONLY on the homepage… it does not affect any other pages.
Add the following code just before the </body> tag at the very bottom of your theme.liquid file to redirect a spesific product to homepage. When adding the product link, use the product path in the URL. For example: /products/example-product.