Client Area

How to Manage Error Pages (404, 500)

2 min readPublished 26 Mar 2026Updated 23 Jun 2026141 views

In this article

  • 1Default Error Pages
  • 2Customising Error Pages in cPanel
  • 3Customising via .htaccess
  • 4Example Custom 404 Page
  • 5WordPress Custom 404

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

  1. Log in to cPanel.
  2. Go to Advanced > Error Pages.
  3. Select the domain.
  4. Click the error code you want to customise (e.g., 404).
  5. Edit the HTML content.
  6. 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

  1. Click Save.

[screenshot: cPanel error page editor for 404]

Customising via .htaccess

For more control, use `.htaccess`:

  1. Create custom error pages (e.g., `404.html, 500.html) in public_html`.
  2. Add to `.htaccess`:
apache
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
ErrorDocument 403 /403.html

Example 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:

  1. Create a `404.php` file in your theme directory.
  2. Customise it with your site's design.
  3. WordPress automatically uses it for missing pages.

Best Practices

  1. Match your site design — custom error pages should look like part of your website.
  2. Include navigation — help visitors find what they need.
  3. Add a search bar — especially on 404 pages.
  4. Link to homepage — always provide a way back.
  5. Keep it helpful — suggest popular pages or categories.

Need help? Contact our support team at https://domainindia.com/support/client/support.

Was this article helpful?

Your feedback helps us improve our documentation

Still need help? Submit a support ticket