Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I was wondering if I can redirect /products/abc to /pages/abc. Is it possible?
Solved! Go to the solution
This is an accepted solution.
Make sure your pages have exactly same handle as your product
for example /products/abc-123 /pages/abc-123
then past this code to Section> product.liquid(Or whatever your product template's name)
<script> window.location.href = "/pages/{{ product.handle }}" </script>
Yes, you could achieve this by add javascript to your theme. If you are not familiar with coding, I could help.
Yes please help
This is an accepted solution.
Make sure your pages have exactly same handle as your product
for example /products/abc-123 /pages/abc-123
then past this code to Section> product.liquid(Or whatever your product template's name)
<script> window.location.href = "/pages/{{ product.handle }}" </script>
Perfect! Thank you so much
Hi There!
I believe I am having a similar problem.
My website www.quicktub.com has two products pages - 1) from the Debut theme (which I don't want) AND 2) for the actual products page I want
RIght now quicktub.com/products carries the user to a page that shouldn't exist but google is currently showing it as one of the top rankings when you search my product "Quick Tub". I have tried many times to redirect this URL to quicktub.com/pages/products in Shopidy but it won't seem to do it.
Ultimately I want it to redirect to the actual page it should be which is quicktub.com/pages/products
In the ideal world, I would replace the current page quicktub.com/pages/products and properly use quicktub.com/products as the actual page URL as all of my individual products fall under the quicktub.com/products/"product name"
Not sure of this makes sense but any help redirecting would be fantastic. Thank you!
@staudinger /products, and /collections , are collections list pages which shows all collections to show all products.
https://shopify.dev/docs/themes/files/list-collections-liquid
Since these are predefined object endpoints for you cannot redirect from them using the shopify navigation redirects in the admin.
And there's no clear reason why you've instead chosen to forcefully use pages/products as the collection display of your offerings instead of the templates specifically meant for that.
I'd assume from the theme and docs poorly communicating during setup about which template is on that page.
Another factor is probably the customize editor shows 'Collections List' but doesn't show 'Products'
i.e. shopify.com/admin/themes/current/editor#/collections vs. shopify.com/admin/themes/current/editor#/products
As for why it's so highly ranked though a quick glance on your site doesn't show you linking to it,
however a fast look around shows competing businesses using that url structure very effectively so people may assume the same structure when looking at urls for your site and clicking through, sharing, or referencing in their content.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
@PaulNewton - appreciate you taking the time to respond. The ideal link used would in fact be - quicktub.com/products - unfortunately/fortunately I am using Shogun (I’m not a dev) and it has on its own forcefully made me use that URL this is by no means my choice.
With regards to page ranking it might be because I switched from an old website in which that was the URL being used - could be old data.
Do you know if there would be a way to fix this in the backend code?
You cannot change it directly with shopify systems (i.e. no simple redirects).
First you'd want to establish an actual dollar value to this problem and if so consult a SEO specialist. ( or Shogun Expert?)
At the domain level if your name registrar has the tools you may just want to forward that url
There's also using meta refreshes to do the redirect with html (theme code)
For shogun contact shogun now that the problem can be described better, and see what options are available.
Beyond that any shogun questions should be in a separate post as it's off topic, either in the design forum or here in TQA
Afaik you can copy the code from and alternate template for pages and just use that elsewhere.
https://getshogun.com/help/en/articles/3299206-how-to-save-a-page-as-a-reusable-template
https://getshogun.com/help/en/articles/3638504-what-additions-does-shogun-make-to-the-theme
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
@MACRORY This works, perfect thank you!
Can i ask how i can do this for a specific product rather than for all products?
i.e one of my products needs to be a page rather than a product (so i can use a specific widget) but a simple redirect from /products/abc to /pages/abc doesnt seem to work.
can i use this script to happen only when the product.handle is "abc"?
Sure, just use an if statement.
if product.url == 'zzz' or product.id == 'xxx'
window.location.href = '/pages/yyy'
endif
Can i do the opposite i had my site on woocommerce and have decent seo so i would like to make product/* forward to products i have made sure all products are named the same i just need to translate product to products and keep the rest of the url intact .
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024