Custom error pages (404, 500)

404, 500, error pages, htaccess, errordocument · 0 found this helpful

When a visitor opens a page that doesn't exist, the server returns a 404. A custom error page replaces the bare default with your branding and a link home.

Option 1: Error pages in your account

  1. Open Account → Hosting → your site → Files. Under Folder and server rules, click Manage, and find Error pages.
  2. Choose your Domain and the Error code you want, such as 404, then click Edit.
  3. Write your page under Page (HTML).
  4. Click Save page.

We save a file such as 404.shtml in your site folder.

Option 2: Your own HTML page with .htaccess

  1. Create public_html/errors/404.html in Files. Use absolute paths for images and styles, such as /css/site.css.
  2. Add these lines to .htaccess:
# Friendly error pages
ErrorDocument 404 /errors/404.html
ErrorDocument 403 /errors/403.html
ErrorDocument 500 /errors/500.html

Use a path starting with /. A full https:// address in ErrorDocument makes the server send a redirect instead, and the error code is lost.

What to put on a 404 page

  • A short apology: "We can't find that page."
  • A link to the home page, the menu, and your phone number.
  • A search box if you have one.

WordPress

Your theme controls the 404 page through a 404.php template or the block editor's Appearance → Editor → Templates → 404. Use that instead of .htaccess rules.

If something goes wrong

  • Plain server message still appears: the file path is wrong. Test it by visiting the file directly.
  • 404 page returns status 200: the page redirects. Use the /path form shown above.
  • 500 page doesn't show: when a 500 is caused by .htaccess itself, the server can't read the setting. Fix the file first.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.