fb-pixel

How to create custom error pages

Error pages allow users to understand why the browser cannot access a resource on a website.

Creating custom error pages that contain links, buttons, and search bars can prove to be a great way to redirect your users to other resources on your site.

Create custom error pages with cPanel

To create new custom error pages login to cPanel. Reach the “Advanced” section and click on the “Error Pages” tool.

Cpanel Error Pages

From the first section of the page you can choose which domain to manage.

Error Pages Select Domain

The second section of the page will instead allow you to select which error page you wish to edit.

Edit Error Pages

As soon as you select an error page, a web page editor will open. Inside it you’ll be able to manually enter your custom code.

Editor Error Page

After making the changes, press the “Save” button to confirm the changes.

Creating Custom Error Pages

If the operation was successful, a confirmation message will appear.

Error Page Saved

Edit error pages

You can view the full list of error pages by selecting “Show all HTTP error status codes“.

Show All Http Error Status Codes

To edit the custom error pages you just created, select the one you are interested in and replace the code inside it.

Edit Error Pages 404 Error

In the editor, at the top, you can also select some additional elements that you can insert within your page.

Edit Error Pages Insert Tag
  • Referral URL: by selecting this element you can show the address of the web page on which the user was browsing before connecting to your site
  • IP Address: allows you to view the IP address of the user
  • Requested URL: selecting this option will show the address of the web page the user is trying to connect to.
  • Server name: show the name of your internet domain
  • Visitor Browser: shows details about the browser and operating system used by the user
  • Redirection Status Code: detects the numeric code of the error.

In the example below, you can see what a custom 404 error page might look like.

Example Custom Error Page

How to delete error pages

The newly created error pages are located in the public_html folder of your site and have, as a file name, the numeric code related to the error that represents them.

To delete them you’ll have to access the “File Manager” panel of cPanel.

Cpanel File Manager

Right-click on the page you wish to delete and select “Delete” from the context menu.

Delete Error Page

Select the “Skip the trash and permanently delete the files” item and press the “Confirm” button to completely delete the error page from your site.

Permanently Delete Error Page File

Try one of our hosting plans for free and without obligation for 14 days. No payment information required!