My site doesn’t need 404 page. I just want the home page displayed instead of 404 error page. If this is not possible then can i change the characters from “404” to some other words so then it doesn’t look like an error page?
Topic summary
Goal: prevent the 404 (page-not-found) from showing by sending users to the homepage, or at least change the “404” text to something friendlier.
Key points and options:
- Redirect approach: Some suggest redirecting 404s to the homepage via JavaScript or Liquid (Shopify’s templating language). One proposal checks if the template is 404 in theme.liquid and then redirects. However, the shared code snippets are incomplete (no actual redirect code provided).
- Custom 404 page: Others recommend customizing the 404 template via the Theme Customizer to provide helpful navigation and messaging. An image was shared illustrating where to customize.
- Feasibility disagreement: One view says it’s not possible to redirect every wrong URL to the homepage; another claims redirects can be set up (no concrete, universal method shown).
Latest developments:
- Instructions to edit main-404.liquid and theme.liquid were posted, but code blocks lacked the redirect logic.
- A participant asked for clearer next steps, noting their editor opens a CSS view and asking where to add text/code.
Status: Unresolved. Concrete redirect code and exact placement steps are still needed, or proceed with customizing the 404 page.
@Foolfully thanks for posting here,
So redirect to another page or back page. with js.
or
create new informative template for 404 page
Hi @Foolfully
This is not possible to redirect every wrong URL to the home page instead you can customize the 404 page using the theme Customizer
Hi @Foolfully ,
This is Theodore from PageFly - Shopify Page Builder App.
Shopify allows you to handle 404 errors in two ways:
-
Redirect: Set up a redirect to send users who land on non-existent pages to your homepage instead of showing a 404 error message.
-
Customize 404 Page: If redirects aren’t possible, edit the existing 404 error page. Change the “404” text to a friendlier message (e.g., “Oops! We can’t seem to find that page”) and include navigation elements to help users find what they need.
Best regards,
Theodore | PageFly
I need to redirect all possible 404 pages to home so 404 can never be displayed. If you use a bad domain extension then you always go to home. Why anyone even invent 404 page when it could just be home page. Must’ve been a negative person to make needless errors.
Hi @Foolfully
- In your Shopify Admin go to online store > themes > actions > edit code
- Find sections > main-404.liquid and paste this at the bottow of the file:
Hi @Foolfully
Here is another approach
Add this code in theme.liquid after the tag
This will check If the current template is 404 or not and if 404 it will redirect to the home page.
{% if template contains '404' %}
{% endif %}
Can you give the next steps to this solution please? Takes me to CSS and not a text editor box. Can I just add text here?
