Creating Custom Error Pages (404, 403, 500)

When something goes wrong — a broken link, a forbidden directory, or a server fault — visitors see an error page. The default pages served by Apache or LiteSpeed are stark and generic, offering no navigation back to your site. Replacing them with custom branded pages keeps visitors oriented and gives you a chance to guide them toward useful content instead of losing them entirely.

Replace default browser errors with your own branded pages.

Common HTTP Error Codes

CodeMeaningCommon Cause
400Bad RequestMalformed URL or request
401UnauthorisedMissing authentication
403ForbiddenFile permissions or IP block
404Not FoundBroken link or deleted page
500Internal Server ErrorPHP fatal error or bad .htaccess

Method 1: Using the cPanel Error Pages Tool

cPanel provides a built-in editor for common error codes.

  1. Log in to cPanel at clients.cyclebreezehost.com.
  2. Go to Advanced → Error Pages.
  3. Select the domain you want to customise from the dropdown.
  4. Click on the error code you want to edit (e.g., 404 Not Found).
  5. Write your HTML directly in the editor. Use the available tags (shown as buttons in the editor) to insert dynamic values such as:
    • <!--#echo var="HTTP_REFERER" --> — the referring URL
    • <!--#echo var="REQUEST_URI" --> — the URL that caused the error
  6. Click Save when done.

Repeat this process for each error code you want to customise.

Method 2: Creating HTML Files Manually

For full control over design, create standalone HTML files and reference them from .htaccess.

Step 1 — Create the error page files

  1. Open File Manager in cPanel and navigate to public_html.
  2. Create a new folder called errors (or any name you prefer).
  3. Inside that folder, create files named 404.html, 403.html, and 500.html.
  4. Edit each file with your branded HTML. Keep pages lightweight — avoid heavy JavaScript or external stylesheets that might themselves fail to load during a server error.

Example 404.html structure:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Page Not Found – YourSite</title>
</head>
<body>
  <h1>We couldn't find that page.</h1>
  <p>It may have moved or been deleted.</p>
  <a href="/">Return to homepage</a>
</body>
</html>

Step 2 — Point Apache/LiteSpeed to your files

  1. In File Manager, open the .htaccess file in public_html (enable hidden files if it is not visible).
  2. Add the following directives, adjusting paths to match your file locations:
ErrorDocument 403 /errors/403.html
ErrorDocument 404 /errors/404.html
ErrorDocument 500 /errors/500.html
  1. Save the file. Changes take effect immediately.

Testing Your Error Pages

  • 404: Visit a URL you know does not exist on your site — for example, https://yourdomain.com/this-page-does-not-exist.
  • 403: Temporarily set a folder's permissions to 000 using File Manager → Permissions, then visit its URL. Reset permissions afterward.
  • 500: Introduce a deliberate syntax error in a .php file, reload the page, then fix it.

Best Practices

  • Include your site's main navigation on custom error pages so visitors can continue browsing.
  • Add a search bar on 404 pages to help users find what they were looking for.
  • Log 404 errors using a web analytics tool to find and fix broken internal links over time.
  • Keep the 500 error page fully self-contained (inline CSS) so it renders even if your CDN or external resources are unreachable.
  • Ensure custom error pages return the correct HTTP status code — the page content is separate from the status code the server sends.

If your custom error pages are not appearing after editing .htaccess, check for syntax errors in the file or contact CyclebreezeHost support at info@cyclebreezehost.com. The team is available 24/7.