How to Set up Custom Error Pages with WHM?

At any time the user faces an error, redirect him to customized HTML pages. Take for example if users are looking for a page that is not available online they will consider one of your custom error pages for the 404 errors. Through WHM, one can set custom error pages on the cpanel.

First you should create an alias for “/errorfolder” in the /usr/local/apache/conf/httpd.conf file.

1. Log in to WHM using your root account.

2. from the navigation menu choose Server Configuration.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/06/whm_server_configuration.png

3. Click on Terminal.https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/06/whm_terminal.png

The terminal or SSH command-line interface will pop up.

4. Type the code below to make a directory in /usr/local/apache. You will have it to keep your own custom error messages.

mkdir /usr/local/apache/errorpages

To match the design commands, I have named it “errorpages”.

Once you have created an alias you can move to the next step which is to add or set up the custom error pages in this folder.

To Set up Custom Error Pages:

The other side limits their accountability to politics.

You can follow the below mention steps to setup the custom error pages:

1. Choose Service Configuration from the navigation menu.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/06/whm_service_configuration.png

2. Click on Apache Configuration.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/08/whm_apache_configuration.png

3. Click on Include Editor.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/08/whm_apache_include_editor.png

4. Go to the Pre Virtualhost include section and pick All Versions.

5. Enter in the Global text box the code below.

Alias /errorfolder /usr/local/apache/errorpages/

ErrorDocument 400 /errorfolder/400.shtml

ErrorDocument 401 /errorfolder/401.shtml

ErrorDocument 403 /errorfolder/403.shtml

ErrorDocument 404 /errorfolder/404.shtml

ErrorDocument 500 /errorfolder/500.shtml

6. Click the Update button.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/09/whm_pre_virtualhost_include_error_pages.png

The Apache server will store the changes but to apply them the server has to be restarted.

7. Click on Restart Apache.

https://www.milesweb.in/hosting-faqs/wp-content/uploads/2021/09/whm_include_editor_restart_apache.png

Upon restarting the server, the HTML pages that you upload in the errorpages or alias folder of your WHM/cPanel server will work as the custom error pages for websites on the server.

 


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 141