HostSEO Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog


How to add custom error pages

  • Category : cPanel Question
  • Posted on : Mar 22, 2020
  • Views : 820
  • By : HostSEO

Error pages are displayed when a user enters a wrong/outdated URL or when one is not authorized to access a specific directory of your web space. cPanel allows you to customize the default view and adjust the way the error is displayed:

for cPanel paper_lantern theme
for cPanel x3 theme

for cPanel paper_lantern theme:

1. Log into your cPanel.
2. Navigate to Advanced section > Error Pages menu:

3. Select the domain name in from Managing drop-down menu and click on the error you wish to change:

If you cannot find the needed error code in Edit Common Error Codes tab, switch to Show All HTTP Error Status Codes:

4. Once the error code is selected, you will be taken to HTML editor that provides the following tags:

  • Requested URL: displays the intended URL the visitor is trying to view.
  • Server name: displays the web site's server name.
  • Visitor's browser: displays the visitor's browser type such as Internet Explorer, FireFox, Netscape, etc.
  • Redirect Status Code: displays the type of code in the 300-307 range, to learn more follow this link.

Make sure that you Save the changes.

5. After that the .shtml file will be placed to the root directory of your website:

6. In order to connect .shtml to your website, you need to add the corresponding rule to .htaccess file.

If you cannot locate .htaccess, enable Show Hidden files (dotfiles) option in Settings menu:

If there is still no .htaccess file in your File manager, feel free to create a new one using File option:

7. After that right-click on the file and use Edit option:

Add the following rule:

ErrorDocument 500 /500.shtml

Note, that error code and file name should be adjusted accordingly. For example, if you wish to connect 404.shtml, the rule should look like:

ErrorDocument 404 /404.shtml

for cPanel x3 theme:

1. Log into your cPanel.
2. Navigate to Advanced section > Error Pages menu:

3. Select the domain name in from Managing drop-down menu and click on the error you wish to change:

If you cannot find the needed error code in Edit Common Error Codes tab, switch to Show All HTTP Error Status Codes:

4. Once the error code is selected, you will be taken to HTML editor that provides the following tags:

  • Requested URL: displays the intended URL the visitor is trying to view.
  • Server name: displays the web site's server name.
  • Visitor's browser: displays the visitor's browser type such as Internet Explorer, FireFox, Netscape, etc.
  • Redirect Status Code: displays the type of code in the 300-307 range, to learn more follow this link.

Do not forget to Save the changes.

5. After that the .shtml file will be placed to the root directory of your website.

Move to File Manager menu in cPanel, select Document root for option and your domain from the drop-down menu. Make sure that Show Hidden Files (dotfiles) is enabled:

6. In order to connect .shtml to your website, you need to add the corresponding rule to .htaccess file.

If you cannot locate .htaccess file in your website root directory, feel free to create a new one using New File option:

7. After that right-click on the file and use Edit option:

 

Add the following rule:

ErrorDocument 500 /500.shtml

Note, that error code and file name should be adjusted accordingly. For example, if you wish to connect 404.shtml, the rule should look like:

ErrorDocument 404 /404.shtml

That's it!

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar

SatSunMonTueWedThuFri
 1
2345678
9101112131415
16171819202122
23242526272829
30 

Born in 2004 ... Trusted By Clients n' Experts

SEO Stars

They never made me feel silly for asking questions. Help me understand how to attract more people and improve my search engine ranking.

Read More

Emily Schneller Manager at Sabre Inc
SEO Stars

Took advantage of Hostseo's superb tech support and I must say, it is a very perfect one. It is very fast, servers reliability is incredible.

Read More

Leena Mäkinen Creative producer
SEO Stars

We're operating a worldwide network of servers with high quality standards requirements, we’ve choose hostseo to be our perfect partner.

Read More

Ziff Davis CEO at Mashable
SEO Stars

It’s very comfortable to know I can rely about all technical issues on Hostseo and mostly that my website and emails are safe and secured here.

Read More

Isaac H. Entrepreneur
SEO Stars

With hostseo as a hosting partner we are more flexible and save money due to the better packages with great pricing, free SEO n' free SSL too!

Read More

Madeline E. Internet Professional