When a visitor hits a missing page or an error, the server shows a plain technical message by default. A custom error page keeps your branding, explains what happened and links back to useful pages, so visitors stay on your site instead of leaving. cPanel's Error Pages tool creates them without coding.
Before you start
- Content management systems such as WordPress, Joomla or shop software show their own theme-based 404 page for URLs they handle. Customise those inside the CMS. cPanel error pages apply to static sites and to errors the CMS never sees (for example 403 or 500 from the server).
- Prepare short texts and links: home page, search, contact.
Create an error page
- Open cPanel → Advanced → Error Pages.
- Choose the domain from Managing.
- Click the error code, for example 404 (Not Found). Use Show All HTTP Error Status Codes for less common ones.
- Write the page in HTML in the editor. Use the buttons above it to insert server tags:
- Referring URL: where the visitor came from
- Visitor's IP Address
- Requested URL: the address that failed
- Server Name, Visitor's Browser, Redirect Status Code
- Click Save. cPanel creates a file such as
404.shtmlin the domain's document root.
A simple, useful 404 page:
<h1>Page not found</h1>
<p>Sorry, <!--#echo var="REQUEST_URI" --> does not exist (any more).</p>
<p><a href="/">Go to the home page</a> or <a href="/contact">contact us</a>.</p>Tip: Use absolute links (starting with /) and absolute paths for CSS and images in error pages. They can be shown for any URL depth, so relative links break.
Use your own page file with .htaccess
You can point errors to any page you designed, even a PHP page, with ErrorDocument lines in .htaccess:
ErrorDocument 404 /errors/not-found.html
ErrorDocument 403 /errors/forbidden.html
ErrorDocument 500 /errors/server-error.html- Always use a local path, not a full
https://URL. A full URL makes the server send a redirect with status 302 instead of 404, which confuses search engines. - A 500 page should be plain HTML, because PHP may be the thing that is broken.
Which errors are worth a custom page?
| Code | When |
|---|---|
| 404 Not Found | Missing pages; the most common and most important |
| 403 Forbidden | Blocked folders or IPs |
| 500 Internal Server Error | Script or configuration failures |
| 401 Unauthorized | Cancelled login on a password-protected folder |
| 503 Service Unavailable | Maintenance or overload |
Troubleshooting
- Custom page not shown: the CMS handles the URL; edit its 404 template. Or another
ErrorDocumentline overrides yours. - Page shows unstyled: relative paths to CSS; make them absolute.
- Fixing the errors themselves: see 404, 403 and 500 guides.
