Question: How do I create custom error pages (404, 403, 500)? Print

  • GHFS Hosting, GHFS web hosting, VPS hosting setup, GHFS cloud hosting, SSD web hosting, shared hosting guide, best hosting provider, managed hosting services, SSL certificate troubleshooting, domain and hosting tutorials, how to transfer a domain, hosting control panel tutorial, email hosting setup, how to register a domain, SSL installation guide, CNAME configuration, MX record setup, DNS records explained, A record guide, optimize WordPress performance, fix internal server error, DNS configuration guide, enable SSH access, FTP upload guide, hosting knowledge base, WordPress migration guide, WordPress installation GHFS, secure VPS server, secure hosting best practices, MySQL database tutorial, PHP configuration guide, Linux server commands, malware removal guide, website security tutorial, DDoS protection GHFS, firewall configuration VPS, disable root login SSH, VPS hosting tutorial, how to manage Linux VPS, cloud server configuration, Node.js on VPS, install Docker on VPS, Nginx setup GHFS, email deliverability guide, Python hosting tutorial, SSL troubleshooting, secure website setup, cPanel tutorial, hosting troubleshooting guide, hosting performance optimization, Apache configuration guide, Redis installation, SMTP configuration guide, Plesk tutorial, MySQL optimization, server hardening tutorial
  • 0

Answer : 

Custom error pages allow you to replace default server error messages with your own branded design. This improves user experience and keeps visitors on your site even when something goes wrong.

GHFS Hosting and Plesk make it easy to create and manage custom error documents.


1. What Error Pages Can Be Customized?

Common customizable error codes include:

  • 404 – Page Not Found

  • 403 – Forbidden

  • 500 – Internal Server Error

  • 401 – Unauthorized

  • 502 / 503 / 504 – Gateway errors (depending on server setup)

You can replace these pages with custom HTML, PHP, or WordPress templates.


2. Method 1: Create Custom Error Pages in Plesk (Recommended)

Plesk allows you to upload your own error page files.

Steps:

  1. Log in to Plesk

  2. Go to Websites & Domains

  3. Select your domain

  4. Click Hosting Settings

  5. Ensure Custom Error Documents is enabled

  6. Save settings

  7. Go to File Manager

  8. Open the directory:
    /error_docs/

Inside this folder you will find files like:

  • 404.html

  • 403.html

  • 500.html

You can edit these files directly or upload new ones.


3. Method 2: Create Your Own Custom Error Files

If the folder does not contain a file you want to customize, simply create it.

Example: create a file named:

  • 404.html

  • 403.html

  • 500.html

Add your custom design and content, such as:

  • A message

  • Navigation links

  • Branding

  • A search bar

Upload the file into the /error_docs/ directory.


4. Method 3: Use .htaccess to Point to Custom Error Pages (Apache)

If your site uses Apache, you can manually define custom error pages.

Add the following lines to your .htaccess file:

 
 
ErrorDocument 404 /error_docs/404.html ErrorDocument 403 /error_docs/403.html ErrorDocument 500 /error_docs/500.html

This tells the server which file to display for each error.


5. Method 4: WordPress Custom Error Pages

If you run WordPress, you can create custom templates inside your theme.

For a custom 404 page:

Create a file in your theme folder:

 
 
/wp-content/themes/yourtheme/404.php

WordPress will automatically use this file.

For 403 or 500 errors, you will typically use:

  • A security plugin that supports custom errors

  • Redirection rules

  • Custom maintenance pages


6. Method 5: nginx Custom Error Pages (Advanced)

If your domain uses nginx, add directives in Plesk:

  1. Go to Apache & nginx Settings

  2. Scroll to Additional nginx directives

  3. Add:

 
 
error_page 404 /error_docs/404.html; error_page 403 /error_docs/403.html; error_page 500 /error_docs/500.html;

Upload your custom HTML files into /error_docs/.


7. Tips for Designing Good Error Pages

  • Use simple, friendly text

  • Include a link back to the homepage

  • Add a search bar (especially for 404 pages)

  • Keep branding consistent

  • Offer suggestions for what users can do next

  • Avoid technical explanations


8. When to Contact GHFS Hosting Support

Contact support if:

  • Custom error pages do not display

  • You need help editing server rules

  • Your hosting plan restricts custom error documents

  • nginx or Apache directives cause errors

  • You use WordPress and errors persist due to plugin conflicts

Support can configure error handling on your behalf.



Was this answer helpful?

« Back