How to fix 404 or page not found error in Shopify?

A 404 not found error is an HTTP status code that means that the page you wanted to access a website couldn’t be found on their server. The message is sent from the webserver of an online presence to the web browser (usually the client) that sent the HTTP request, then the browser displays this error code.

In this article, I’ll guide you, how to redirect 404 page to your home page. Please follow step by step:

1.From your Shopify admin, go to Online Store > Themes.

2. Select the theme you want to edit, and then click Actions > Edit code.

3 .In the Templates folder, click 404.liquid f1le.

4. Remove all existing code, and paste the below code to this file.

{% layout none %}<script>window.location.replace("Enter your home page URL");</script>

5. Click on Save

When any page of your Shopify store is not found, instead of showing a 404 page, they will be redirected to your Shopify home page.

Also, you can use another way:

We can set up redirects in Shopify stores by following these steps.

1.Log in to your Shopify store, go to Online Store.

2. Click on the Navigation section on your left sidebar on the menu.

expoundsofttechsolution

3. Click on the ‘URL redirect’ link, then click on Create URL redirect.

expoundsofttechsolution

4. Enter the old URL that you want to redirect customers from, in Redirect from field.

expoundsofttechsolution

5. Enter the new URL that you want to redirect customers to, in Redirect to field.

expoundsofttechsolution

6. Click on Save Redirect.How to fix 404 or page not found error in Shopify.

expoundsofttechsolution
Also, you can use this codeexpoundsofttechsolutionHow to fix 404 or page not found error in Shopify.
{% if template == '404' %}
<script>
   window.location.href = "Enter your home page URL";
</script>
{% endif %}

Note: In shopify, we can’t redirect URLs that begin with the following prefixes: /apps, /application, /cart, /carts, /orders, /shop, or /services.