How can I redirect my ecommerce site link to my product page?

Jarch
Tourist
30 0 1

For a little background, I have a one product Shopify store and am using the Spark theme. With this theme, you can only have 'featured products' on the homepage. But products you put on the homepage don't have all the features like apps or reviews. So I'm looking for a way to completely remove my homepage, make my site link redirect to my product page, or make it so my homepage have a normal product option. 

Replies 7 (7)
Jasoliya
Shopify Expert
4817 623 1220

You have to add in script like below

<script>
window.addEventListener('load', function() {
  window.location.href = 'http://www.example.com/products/product_page';
});
</script>
Want custom changes? hire me.
3 months of Shopify for $1/month. Look here.
Email us Or WhatsApp, Try our Free app for product bundles and Codify Order Cancel or Order edit
Want to get Free review and advice for sale on store ?? just text me here
migo_d7
Visitor
1 0 0

how and where do I add that ??? 

Jasoliya
Shopify Expert
4817 623 1220

you have to add in Js file. which theme do you have ? send me link

Want custom changes? hire me.
3 months of Shopify for $1/month. Look here.
Email us Or WhatsApp, Try our Free app for product bundles and Codify Order Cancel or Order edit
Want to get Free review and advice for sale on store ?? just text me here

Jasoliya
Shopify Expert
4817 623 1220

Hi @Jarch 

you can use this code to redirect your home page to product page direct

1. add this code in "layout->theme.liquid", before </head>

window.addEventListener('load', function() {
  window.location.href = 'http://www.example.com/products/product_page';
});

Note: change url to your product page

 

Best regard 

Want custom changes? hire me.
3 months of Shopify for $1/month. Look here.
Email us Or WhatsApp, Try our Free app for product bundles and Codify Order Cancel or Order edit
Want to get Free review and advice for sale on store ?? just text me here
Jarch
Tourist
30 0 1

Hello, I added the code before </head> and changed the URL but the code just shows up in a white space above the header announcement bar. 

Vyk
Shopify Partner
14 0 5

Hi, in Shopify the homepage cannot be deleted. You can try redirecting home page to your collection or product page.

 

  1. Click on "Navigation" or "URL Redirects" (the option might vary depending on your Shopify theme).

  2. Look for an option to create a URL redirect. It may be labeled "URL Redirects," "URL Redirect Manager," or something similar.

  3. Create a new redirect with the source URL being / (which represents the homepage) and set the target URL to the new destination URL you want.

  4. Save your changes.

ALSO you can do the same thing with code (this is working one). Add before head in theme.liquid. ( '/' represents the home page)

<script>
window.addEventListener('load', function() {
  // Check if this is the homepage
  if (window.location.pathname === '/') {
    // Redirect to the desired URL
    window.location.href = 'URL of the page you want to get redirected to';
  }
});
</script>

 

ogikovacevic202
Visitor
1 0 0

This doesn't really solve the issue because it still loads up the homepage then it loads the product page. Theres gota be a way to fully direct traffic to the singe main domain but lands on product page.

Here is an example shop that achieves this.
https://www.shopbotaniqueparis.com/