I was wondering if I can redirect /products/abc to /pages/abc. Is it possible?
Yes, you could achieve this by add javascript to your theme. If you are not familiar with coding, I could help.
Yes please help
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 Collections â Quick Tub 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 Accessibility Bathtub Cut Outs | Quick Tub 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 Accessibility Bathtub Cut Outs | Quick Tub
In the ideal world, I would replace the current page Accessibility Bathtub Cut Outs | Quick Tub and properly use Collections â Quick Tub as the actual page URL as all of my individual products fall under the Collections â Quick Tubâ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.
@PaulNewton - appreciate you taking the time to respond. The ideal link used would in fact be - Collections â Quick Tub - 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
@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 .