StarDomain

Custom Error Pages (403, 404, 500)

Custom Error Pages (403, 404, 500)

Create custom error pages to provide a better user experience when errors occur.

What Error Codes Mean

CodeMeaning
400Bad Request
401Unauthorized
403Forbidden — no permission to access
404Not Found — page does not exist
500Internal Server Error
502Bad Gateway
503Service Unavailable

In cPanel

  1. Go to Error Pages
  2. Select the error code
  3. Edit the HTML content
  4. Save

Via .htaccess

Add these lines to your .htaccess file:

apache
ErrorDocument 404 /errors/404.html
ErrorDocument 403 /errors/403.html
ErrorDocument 500 /errors/500.html

Then create the corresponding HTML files in an errors folder.

Best Practices for Error Pages

  • Include your site branding and navigation
  • Provide a search box or links to popular pages
  • Keep the page lightweight (no heavy scripts)
  • Suggest the homepage or contact page
  • Do not reveal technical details to visitors

WordPress

WordPress handles 404 pages through your theme 404.php file. Edit this in Appearance → Theme Editor or via FTP.