Overview

If you're setting up a redirect from a Product page in the Online Store > Navigation > URL Redirects section of the Shopify admin panel, you need to keep in mind that URL redirects can only be used on URLs that would otherwise lead to a 404 Not Found page. There's no way to redirect valid URLs. 

Typically, this would require the Product to be deleted from the store so the redirect could be setup, but we obviously don't want that to happen. So we came up with a workaround method to accomplish this instead. 

If you'd like your Shopify Product page (/products) to redirect to a Zipify Page (/pages) without setting up a Redirect in your Shopify admin, follow the steps below. 

Note: Use at your own discretion. Adding this workaround is an unsupported customization that is outside the scope of our support service. This means that we're not able to help you if you run into problems. We do not take responsibility for how implementing this change on your store will affect your conversion tracking or SEO. 

1) Within your Shopify admin, go to Online Store > Themes > Actions > Edit code

2) Under the Templates section, click the "Add a new template" link to add a new template file. 

3) Add a new Product template and name it accordingly I.e. redirect.product or whatever you'd like to name it.

4) Add this redirect code to the very top of the new template file, above everything else listed there:

{% if product.handle == "product-handle" %}
<script>// <![CDATA[
window.location.replace("URL");
// ]]></script>
{% endif %}

Where product-handle is listed in the script above, enter your default product page handle. For example, if your product page URL is https://www.boombycindyjoseph.com/products/boomstick-glo then the product-handle is boomstick-glo

Where URL is listed in the script above, enter the URL of the ZP page that you want to redirect to.  

Make sure to include the quotation marks around the product-handle and URL within the script, just as it's shown above. Then Save the new product template file. 

5) Go to the Products section of your Shopify admin and open the product that you want to be redirected to the ZP page. Assign the new Template file you just created to the product in the Theme templates section and Save

6) Test out the redirect by viewing your product page as you normally would to ensure it redirects properly. 

When someone goes to the default Product page, the script replaces the current source URL with the new one specified in the script I.e. your Zipify Pages page URL. This way no initial URL is stored and so the customer can't click the Back button in a web browser and get to the default product page.

Did this answer your question?