Custom error pages (404, 500)
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
- Open Account → Hosting → your site → Files. Under Folder and server rules, click Manage, and find Error pages.
- Choose your Domain and the Error code you want, such as 404, then click Edit.
- Write your page under Page (HTML).
- Click Save page.
We save a file such as 404.shtml in your site folder.
Option 2: Your own HTML page with .htaccess
- Create
public_html/errors/404.htmlin Files. Use absolute paths for images and styles, such as/css/site.css. - 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
/pathform shown above. - 500 page doesn't show: when a 500 is caused by
.htaccessitself, the server can't read the setting. Fix the file first.
Still stuck? Ask us and we'll walk you through it.