11 Floor Insular Life Building Makati 11 Floor Insular Life Building Makati
  • General

CUSTOM ERROR PAGES

When your site generates an error such as a “404 page not found”, it sends users to an error page. You can configure your own custom error code pages with your branding and your own description if you wish. This is done by creating an html page, for example “404.shtml” with the message that you want.

Errors from 400 to 499 are client errors caused by something you did on your browser. Error codes between 500 and 599 are caused by errors on the server.


What is a Custom Error Page?

If you’ve ever visited a website that encounters an error, you’ve probably seen an error page that informs you what type of issue the site is having. For example, when a page cannot be found, you’ll see an error 404. Here is a comprehensive list of all the HTTP error codes and their meaning: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes


Creating Custom Error Pages

If you’d like to create a custom page for your own account, you’ll need to log on to cPanel and choose the option for “Error Pages” in the “Advanced” section. Choose the domain or subdomain you wish to use and select the page you’d like to edit. Replace the code inside with your own custom page code in either HTML or SHTML. Once you select save, your changes will be applied.


Don’t know how to write HTML?

With a design program like Website Builder, you simply publish an error page you’d like to use. Visit your web page online and pull up the new page you created. Choose View > “Source” or “Page Source” from the top of the browser window. Select all the text from the page that appears by right clicking and choosing “Select All”, then “Copy” after right clicking again. From here, you can paste the code in cPanel.

Don’t forget to remove the page in the Website Builder after you’re done with it.


Troubleshooting Error Pages

Changes to your Custom Error Pages can only be seen after refreshing your browser window (ctrl+f5). If you’re still seeing old pages, you’ll need to add the following line to your .htaccess file inside public_html:


ErrorDocument 403 /403.shtml

ErrorDocument 404 /404.shtml

ErrorDocument 404 /404.shtml

More in depth instructions on how to edit your .htaccess file can be found here:


• How to Edit Your .htaccess File #027

If you’d like visitors to be redirected to a different page instead of seeing an error like 404, you can use an existing page as a Custom Error Page. If you’d like people to see your home page instead, you could use the following:

• ErrorDocument 404 /index.html

If you’d like visitors to be redirected to a different page instead of seeing an error like 404, you can use an existing page as a Custom Error Page. If you’d like people to see your home page instead, you could use the following:

• ErrorDocument 404 /index.html

Internet Explorer will only display a custom error page if it is larger than 1 kilobyte (1 kb).

Going back to Default Error Pages

By removing the Custom Error Page, the default will be shown in its place, so you can delete the files you created like:


404.shtml

403.shtml

500.shtml