How To Redirect 404 Error To Home Page or Non Shopify URL To Home Page?

Highlighted
Tourist
7 0 2

Let's say I have a website www.example.com and this is designed by Shopify.

So how to redirect any non shopify URL for example- www.example.com/asjghjgwqsdjsjk to www.example.com.

Or any 404 error to www.example.com

Please Note: I have gone through 404 Redirects in this forum but it is not correct what I am looking for. It is written that if the product is out of stock then it will redirect to Home Page URL, which I don't want to do.

Your help highly appreciated and correct answer will be upvoted. Please share your knowledge.

1 Like
Tourist
7 0 2

I am quite surprised to see that no Shopify Expert has not replied to my thread till now. Is this question so difficult to Shopify Experts?

0 Likes
Shopify Staff
Shopify Staff
5826 0 251

You can create URL directs on your Navigation page. This creates actual redirects recognized by search engines. Search engines learn about the new URL for a page. That feature does not work with wildcards.

For any 404 Not Found that isn't redirected with a store URL redirect, then you can send customers over to your home page by adding the following HTML as close as you can to your opening head tag in your theme.liquid file:

{% if template == '404' %}<meta http-equiv="refresh" content="0;URL={{ shop.url }}" />{% endif %}

 

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
2 Likes
Tourist
7 0 2

Thank you so much Caroline... It worked nicely.... Again thank you and have wonderful days always.....

Best Regards

Kalu

1 Like