To set a custom error page on shared or WordPress hosting, open cPanel's Error Pages tool and edit the page for the status code you want (404, 500, and so on), or add an ErrorDocument line to your .htaccess file pointing at your own HTML file. If your site runs WordPress, skip both: WordPress already serves its own themed 404 page for missing URLs, and editing cPanel's error pages won't touch it.
Using cPanel's Error Pages tool
This is the fastest way to get a branded error page without touching server config files directly.
- Open cPanel from your hosting service. See Accessing cPanel if you need the way in.
- Find Error Pages under the Advanced section.
- Pick the domain, if you have more than one on the account.
- Choose the status code to customize. 404 (page not found) is the common one, but you can also set pages for 403 (forbidden), 500 (internal server error), and others.
- Edit the HTML in the box provided. cPanel gives you a set of placeholder tags (for the requested URL, the referring page, and so on) you can drop into the markup.
- Save.
This method writes the page for you and wires up the redirect, so there's nothing else to configure.
Using .htaccess directly
If you'd rather host your own error page file and point Apache at it manually, add a line like this to .htaccess in your site's root:
ErrorDocument 404 /errors/404.html
The path is relative to your document root. Upload the HTML file to that location first, either through the portal's file manager or an FTP/SFTP client. See Creating MySQL databases and the files tile in your service for background on getting files onto the server if you haven't used the file manager before.
You can repeat the ErrorDocument line for each status code you want to customize:
ErrorDocument 404 /errors/404.html
ErrorDocument 500 /errors/500.html
ErrorDocument 403 /errors/403.html
Keep the target file small and self-contained. Avoid pointing an ErrorDocument at a page that itself depends on a database call or a PHP include that could fail, since a broken error page produces a second error.
Absolute vs. relative paths
A path starting with / is relative to your document root, not the filesystem root, so /errors/404.html means public_html/errors/404.html on a typical account. You can also point ErrorDocument at a full URL (https://yourdomain.com/errors/404.html), which works but adds an extra DNS/HTTP round trip compared to a local path.
WordPress is different
WordPress intercepts requests through its own routing and serves 404.php from your active theme whenever nothing matches, before Apache's ErrorDocument setting ever gets a say for that domain's front end. To change what visitors see on a broken WordPress URL, edit or replace 404.php in your theme (a child theme, ideally, so an update doesn't wipe your changes) rather than setting cPanel's Error Pages tool. cPanel's 404 page will still apply to non-WordPress paths on the same domain, like a raw file request that 404s below the WordPress install, but not to normal front-end 404s.
When to contact support
If your .htaccess edit results in a server error on every page instead of only the missing-page case, or you're not sure whether a redirect loop is coming from ErrorDocument or from something else in .htaccess, open a ticket from the portal (Support → New ticket) or use live chat. A real person can check the error logs and tell you exactly which line is causing it.