How to Manage Error Pages (404, 500)
Customise the error pages visitors see when something goes wrong on your website.
Default Error Pages
Web servers show default error pages for common errors:
- 400 Bad Request — the server cannot process the request.
- 401 Unauthorized — authentication required.
- 403 Forbidden — access denied.
- 404 Not Found — the page does not exist.
- 500 Internal Server Error — server-side error.
Customising Error Pages in cPanel
- Log in to cPanel.
- Go to Advanced > Error Pages.
- Select the domain.
- Click the error code you want to customise (e.g., 404).
- Edit the HTML content.
- Use the available tags:
- `<!--#echo var="REDIRECT_STATUS" -->` — the error code
- `<!--#echo var="REDIRECT_URL" -->` — the URL that caused the error
- `<!--#echo var="HTTP_HOST" -->` — your domain name
- Click Save.
[screenshot: cPanel error page editor for 404]
Customising via .htaccess
For more control, use `.htaccess`:
- Create custom error pages (e.g., `
404.html,500.html) inpublic_html`. - Add to `
.htaccess`:
apache
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
ErrorDocument 403 /403.htmlExample Custom 404 Page
Create `public_html/404.html`:
html
<!DOCTYPE html>
<html>
<head><title>Page Not Found</title></head>
<body>
<h1>404 - Page Not Found</h1>
<p>Sorry, the page you are looking for does not exist.</p>
<p><a href="/">Go to Homepage</a></p>
</body>
</html>WordPress Custom 404
WordPress handles 404 pages through your theme:
- Create a `
404.php` file in your theme directory. - Customise it with your site's design.
- WordPress automatically uses it for missing pages.
Best Practices
- Match your site design — custom error pages should look like part of your website.
- Include navigation — help visitors find what they need.
- Add a search bar — especially on 404 pages.
- Link to homepage — always provide a way back.
- Keep it helpful — suggest popular pages or categories.
Related Articles
Need help? Contact our support team at {{SUPPORT_URL}}/client/support.