When a visitor encounters a 404 File Not Found error page on your site, the visitor, whom you've worked hard to obtain through the search engines or third party links, is on the verge of being lost. Creating a custom 404 error page helps you to minimize the number of visitors lost in this manner.
Purpose: A custom 404 page helps retain visitors by guiding them back to useful pages (Home, Sitemap, Search, popular categories) when a URL is invalid.
Your 404 error page is accessible via FTP here:
/custompages/errors/404.htm
Important: This file must behave like a true 404 page (see the “Avoid These Mistakes” section). If your custom 404 page returns the wrong HTTP status, it may need to be removed until corrected.
Here are some tips to help you:
- Include a link to your main page, with a suggestion that the visitor can find what he wants there.
- Include a link to your sitemap, which lists all the pages on your website.
- Some users include a list of frequently mistyped URLs with a link to the correct URL. If you are aware of frequently mistyped URLs, you should consider ordering 301 URL Redirect Service.
- Consider making your 404 page larger than 512 bytes; otherwise, Internet Explorer (IE) may load what it calls its built-in "friendly HTTP error message" instead of your 404.htm page.
Use these best practices to improve user experience and reduce lost sessions when customers land on a bad URL:
- Keep the visitor oriented: Clearly state the page was not found, but keep the tone helpful and on-brand.
- Provide high-intent next steps: Include links to Home, Sitemap, and your most important categories. If your theme supports it, include a Search entry point.
- Prioritize fast load time: Keep the page lightweight; avoid large scripts or heavy assets that slow recovery.
- Use redirects where appropriate: If a URL is commonly mistyped or an old page moved, a 301 redirect is usually a better customer and SEO experience than relying on a 404.
- Prevent broken assets: Use robust link and image paths that work in both http/https and from different directories (see the “Avoid These Mistakes” section).
- Operational follow-up: Periodically review common 404 sources (campaign URLs, old backlinks, mistyped links) and decide whether to fix internal links, publish new content, or implement 301 redirects.
Recommendation: Keep the page helpful and minimal—its job is to recover the session quickly and move the shopper back into browse/buy flows.
Avoid these mistakes when creating a custom 404.htm page:
- Ensure your custom 404 error page is sending a 404 header. If you load a file that doesn't exist, the http header should read 404 Not Found, NOT 200 OK. If your custom 404.htm file does not return the correct header, the 404.htm file will have to be removed until it is corrected.
- Use 301 redirects instead of a 404 error page when possible. 301 redirects are user and spider friendly; the 404 error page is not.
- Don't forget that your 404 error page may be loaded either from the main directory or from a subdirectory and in either http:// or https:// (secure) modes. You should use absolute paths when creating links and use protocol-relative image src paths for images.
Example:
use: <img src="//<PrimaryURL>/images/logo.gif">
instead of: <img src="images/logo.gif"> or <img src="https://<PrimaryURL>/images/logo.gif">
Critical check: After updating 404.htm, validate that a known-invalid URL still returns an HTTP 404 status (not 200).
- Confirm the file is stored at /custompages/errors/404.htm.
- Test an invalid URL and confirm the HTTP status is 404 Not Found.
- Test from multiple contexts: an invalid URL at the domain root and an invalid URL under a subdirectory.
- Test in both http:// and https:// (secure mode), ensuring links and images still load.
- Confirm images use protocol-relative paths (for example,
//<PrimaryURL>/images/...) and links use absolute paths where appropriate. - If applicable, ensure page size is greater than 512 bytes to avoid certain browsers displaying a “friendly” error instead of your custom page.