A customer wants their own branded 404 page. The cPanel UI for this exists, works, and has worked since the late 2000s — yet operators still occasionally drop ErrorDocument directives into a global include or a hand-edited .htaccess and wonder why the change does not stick. The right path is the cPanel Error Pages tool; the verification is checking that the directive actually landed in the vhost include.
What’s happening
cPanel’s “Error Pages” interface (cPanel > Advanced > Error Pages) writes the customer’s chosen content into HTML files at /home/<user>/public_html/<code>.shtml and adds matching ErrorDocument directives to the user’s .htaccess. For the file to be served on the error code, two things must work: AllowOverride must permit FileInfo (covered in the dedicated AllowOverride article), and the file path in ErrorDocument must be absolute relative to the vhost docroot, not the filesystem.
How to verify
For a given account:
ls -la /home/<user>/public_html/*.shtml
grep -r "ErrorDocument" /home/<user>/public_html/.htaccess
apachectl -t -D DUMP_INCLUDES | grep <user>
curl -sI https://example.com/this-does-not-exist.html | head
The curl should return HTTP/1.1 404 plus the body of the custom page if the directive is wired up correctly.
The fix
- From the customer’s cPanel: cPanel > Advanced > Error Pages > pick the error code (404 most commonly) > write or paste HTML > Save. cPanel writes
/home/<user>/public_html/404.shtmland updates.htaccesswithErrorDocument 404 /404.shtml. - If the customer cannot or will not log into cPanel, do the same as root: place the HTML file in their docroot with their ownership, then add the directive to their
.htaccess(or to aPre VirtualHost Includeyou control). - Confirm the
ErrorDocumentis in effect:curl -sI https://example.com/this-does-not-exist.htmlreturns 404, thencurl -s https://example.com/this-does-not-exist.html | headshows the custom page body. - If the directive is in
.htaccessbut the default error page is served,AllowOverridefor the directory is not permittingFileInfo. Either widen the override (per the dedicated article) or move theErrorDocumentto the vhost include. - For accounts where errors should be JSON (an API account),
ErrorDocumentcan point at a PHP script that emits the right headers. Be careful: the error handler is invoked for every error including HEAD requests; do not have it do expensive work. - Server-wide custom error pages are a separate tool — see the companion article. Per-account always wins over server-wide if both are set.
For environments where branded error pages are part of the customer experience, Stack Harbor wires them in during onboarding under cPanel server administration.