> ## Documentation Index
> Fetch the complete documentation index at: https://help.noxity.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Pages

> Customize the page visitors see for 400, 401, 403, 404, 500, and other HTTP errors. Per-domain editor with variable insertion.

Error Pages is an editor for the HTML Apache serves when a request fails with an HTTP error code. The default pages are blank and ugly; this tool lets you replace them with branded ones.

<Frame caption="cPanel home → Advanced → Error Pages">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/advanced/error-pages/page-light.png" alt="Error Pages editor with HTTP code list and HTML textarea" className="block dark:hidden" />

  <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/advanced/error-pages/page-dark.png" alt="Error Pages editor with HTTP code list and HTML textarea" className="hidden dark:block" />
</Frame>

## How to use it

<Steps>
  <Step title="Pick a domain">
    Top of the page. The error pages you edit apply only to the selected domain (and any subdomain or addon under it, unless that subdomain has its own override).
  </Step>

  <Step title="Pick the error code to customize">
    cPanel pre-lists the common ones: **400 Bad Request**, **401 Authorization Required**, **403 Forbidden**, **404 Not Found**, **500 Internal Server Error**. Click the code to open its editor.
  </Step>

  <Step title="Write the HTML">
    The editor is a plain textarea. Paste your HTML. The page is served verbatim, so include `<html>`, `<head>`, `<body>`, your CSS link, etc.

    Use the **Insert** buttons at the top to drop in dynamic placeholders:

    | Placeholder          | Resolves to                       |
    | -------------------- | --------------------------------- |
    | Referring URL        | The page the visitor came from.   |
    | Visitor's IP Address | The client IP.                    |
    | Requested URL        | The URL that triggered the error. |
    | Server Name          | Your domain.                      |
    | Visitor's Browser    | The User-Agent string.            |
    | Redirect Status Code | The HTTP code (e.g., `404`).      |
  </Step>

  <Step title="Save">
    The editor writes the HTML to `~/public_html/<code>.shtml` and adds an `ErrorDocument` line to the domain's `.htaccess`. Live immediately.
  </Step>
</Steps>

## Which errors are worth customizing

| Code                           | Worth it?    | Why                                                                                              |
| ------------------------------ | ------------ | ------------------------------------------------------------------------------------------------ |
| **404 Not Found**              | Always       | Visitors hit broken links often. A useful 404 with search and navigation keeps them on the site. |
| **500 Internal Server Error**  | Yes          | Don't leak the default Apache page; replace with a branded "we're looking into it" page.         |
| **403 Forbidden**              | Sometimes    | If you have password-protected directories, customize to explain rather than show the default.   |
| **401 Authorization Required** | Rarely       | This shows after a failed HTTP Basic Auth attempt; users rarely see it on regular sites.         |
| **400 Bad Request**            | Almost never | Triggered by malformed HTTP requests, mostly by bots. Default is fine.                           |

## Common questions

<AccordionGroup>
  <Accordion title="My custom 404 page shows but the page returns a 200 status code, not 404">
    Ranking-wise, this is a problem: search engines see the page as "found" rather than "missing", so they keep crawling dead URLs. The cPanel-generated `ErrorDocument` directive should already preserve the 404 status, but if you've used JavaScript to redirect or PHP without setting a header, you'll lose it. In PHP at the top of the error page:

    ```php theme={}
    <?php http_response_code(404); ?>
    ```

    Confirm the status code with browser dev tools (Network tab) or `curl -I`.
  </Accordion>

  <Accordion title="The custom page shows on www. but not the bare domain (or vice versa)">
    The Error Pages tool sets the page per the cPanel "primary" name for that domain. If `www` and the bare domain are routed separately (or one is an addon), you'll need to set the error pages for both. Easier alternative: drop a single `.htaccess` line at the root `public_html`:

    ```apache theme={}
    ErrorDocument 404 /404.html
    ```

    That applies to every host pointing at `public_html`.
  </Accordion>

  <Accordion title="A WordPress site shows my custom page only sometimes">
    WordPress handles its own routing, so 404s for URLs *that match WP's routing rules* return WordPress's `404.php` template instead. That's fine: customize `404.php` in your theme. The cPanel error page is the fallback for URLs WordPress never sees, like requests for files outside WP entirely.
  </Accordion>

  <Accordion title="I want to redirect 404s to the homepage instead of showing a page">
    Bad idea for SEO; search engines treat redirects-instead-of-404s as soft-404s. Keep the 404 status. If you want a friendly experience, build a 404 page that includes site search and links to popular content.
  </Accordion>
</AccordionGroup>

## Need a hand?

<CardGroup cols={2}>
  <Card title="Open a ticket" icon="life-ring" href="https://members.noxity.io/submitticket.php">
    Best for anything that needs an account check or a config change on our end.
  </Card>

  <Card title="Live chat" icon="messages" href="https://noxity.io/contact">
    Faster for quick questions during business hours.
  </Card>
</CardGroup>
